Detecting a Java memory leak

It is all too common to find out about a memory leak by the JVM stopping due to an OutOfMemoryError. Before releasing a Java-based product, it should generally be tested for memory leaks. The standard use cases should be run for some duration, and the live set should be measured to see that no memory is leaking. In a good test setup, this is automated and tests are performed at regular intervals.

Note

We got overconfident and failed to heed our own advice in JRockit Mission Control 4.0.0. Normally, we use the Memory Leak Detector to check that editors are reclaimed properly in JRockit Mission Control during end testing. This testing was previously done by the developers themselves, and had failed to find its way into ...

Get Oracle JRockit now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.