My application throws java.lang.OutOfMemoryError: GC overhead limit exceeded
error. I searched it and get enough information. Oracle says :
Cause: The detail message "GC overhead limit exceeded" indicates that the garbage collector is running all the time and Java program is making very slow progress. After a garbage collection, if the Java process is spending more than approximately 98% of its time doing garbage collection and if it is recovering less than 2% of the heap and has been doing so far the last 5 (compile time constant) consecutive garbage collections, then a java.lang.OutOfMemoryError is thrown. This exception is typically thrown because the amount of live data barely fits into the Java heap having little free space for new allocations. Action: Increase the heap size. The java.lang.OutOfMemoryError exception for GC Overhead limit exceeded can be turned off with the command line flag -XX:-UseGCOverheadLimit.
My question is; how can I track heap allocated by GC
, and by my java program. I tried jstat -gcutil
but it is not have enough information. Is there a tool that I can see the rate between my java program heap allocation over GC
heap allocation?
Thanks in advice.