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 analogyThink 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
…