This is a bit dated, but if you're using Java 1.5 or 1.4.2, there's an excellent flag in more recent VM updates: HeapDumpOnOutOfMemoryError. OOMs have to be one of the hardest problems to debug: traditionally, you'll have next to zero information on the cause of the crash. This flag apparently has no runtime cost, and will provide a thorough snapshot of the heap at the time of the crash. I hadn't had a "out of heap space"-style OOM in years, but recently had one. Luckily, this flag was enabled, and I was able to use the "jhat" tool to pretty quickly find the culprit. I had some problems with the java.net HAT tool, but the jhat which is distributed with Mustang worked perfectly. This is one of those simple changes that can really save you later.
All the info
- ▼ February (3)