Why Your Java Service Keeps Dying While the Heap Dashboard Stays Green
A teammate of mine once spent two days chasing a service that kept getting killed. Every dashboard said the memory was fine. It sat at 60%, comfortably. And every few hours the thing died anyway. The problem was that he was watching the wrong memory.
This is probably the single most common misunderstanding in Java operations, and it costs teams real money and real sleep. So here's the whole thing explained without assuming you've read the JVM tuning manual.
The apartment analogy
Think of your container as an apartment with a strict size limit. Say 512 MB. Go one square foot over and the landlord, in this case the Linux kernel, throws you out. No warning, no negotiation. That's an OOM kill.
Now, most people assume the apartment holds one big room: the heap. The heap is where your application's objects live, the user records, the JSON payloads, the cached...
Copyright of this story solely belongs to hackernoon.com. To see the full text click HERE