Thursday 13 September 2018

Java heap memory leak or sizing problem? .

Situation

Occasionally when reviewing a heapdump that was generated from an out of memory event, the largest consumer of heap memory may consume slightly more memory than the other objects. Because of this, WebSphere users and moderators may incorrectly accuse the largest heap consumer as a memory leak.
 
If a Java™ heap is sized too small, an out of memory error will occur regardless if a memory leak exists. The leak suspect shown in IBM HeapAnalyzer or Memory Analyzer (MAT) will show a java object that is expected to exhaust a relatively larger portion of the heap.
 
Resolution

The best course of action will be to increase the heap size and enable verboseGC (if not already enabled). Doing this will produce one of two results: it will alleviate the out of memory problem by letting your heap utilize more memory, or the leaking object will cause another out of memory event. If the test yields the first of the two outcomes, the administrator can then tune the heap appropriately and scale down if need be. If the latter happens, the relative heap memory consumed by the leaking object will be much greater than the other java objects, thus confirming the suspected leaking object as seen by the first heapdump. If the leaking object is an IBM based object then further investigation would be needed, and engaging WebSphere Application Server support using the Service Request (SR) tool is recommended.
 
Related Links:
 

No comments:

Post a Comment