The Garbage Collector in JVM throws this exception when too much time is spent in garbage collection for too little return. e.g. 98% of CPU time is spent on GC and less than 2% of heap is recovered.
This effectively means that your program stops doing any progress and is busy running only the garbage collection at all time.
To prevent your application from consuming up CPU time without getting anything done, the JVM throws this
Solution
Error
so that you have a chance of diagnosing the problem.Solution
- Increase the heap size using -Xmx option, for example
-Xmx1g
. - Enable the concurrent low pause collector
-XX:+UseConcMarkSweepGC
. - Reuse existing objects when possible to save some memory.
If necessary, the limit check can be disabled by adding the option
-XX:-UseGCOverheadLimit
to the command line although this is not advised.
No comments:
Post a Comment