Does the following graph indicate that I am using memory and it is not being garbage collected?
I expected the orange graph (the allocated heap) to go down once I start using less of the heap.
In Java, the memory leak is a situation when the garbage collector does not recognize the unused objects and they remain in the memory indefinitely that reduces the amount of memory allocated to the application. Because the unused objects still being referenced that may lead to OutOfMemoryError.
One way to check for memory leak is to press and hold down your Windows key and tap the Pause/Break key to bring up System Properties. Click on the Performance tab and check System Resources for the percentage of free or available RAM.
It is clear from the graph that your JVM is capable of shrinking the heap. This can be seen from the orange line taking a slight dip just before 3:10pm.
However, later on the JVM chooses to not shrink the heap. This is almost certainly because an insufficiently large fraction of the heap is unused. The behaviour is controlled by -XX:MinHeapFreeRatio
and -XX:MaxHeapFreeRatio
.
For a discussion, see http://stopcoding.wordpress.com/2010/04/12/more-on-the-incredible-shrinking-jvm-heap/
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With