This is the new type of error that JDK6 adds. This error is reported when the JVM's GC behavior exceeds more than 98% of the time to release the heap space less than 2%. Occurs when a GC takes up a lot of time to release a small amount of space and is a protective mechanism. The solution is to turn off the feature and use the ——-xx:-usegcoverheadlimit
Here to see if there is a code that uses large memory or a dead loop.
Sun official explained:
The Parallel/concurrent collector would throw a outofmemoryerror if too much of the time are being spent in garbage collection: If more than 98% of the "total" is spent in garbage collection and less than 2% of the heap are recovered, an outofmemor Yerror would be thrown. This feature are designed to prevent applications from running for a extended period of time while making little or no pro Gress because the heap is too small. If necessary, this feature can is disabled by adding the "option-xx:-usegcoverheadlimit to" command line
First, the exception is as follows:
Exception in thread "main" Java.lang.OutOfMemoryError:GC overhead limit exceeded
Second, explain:
JDK6 new error type. Thrown when the GC takes up a lot of time to free up a small space.
Usually because the heap is too small. Cause of the exception: there is not enough memory.
Third, the solution:
1, to see if the system has the use of large memory code or dead loop.
2, you can add the JVM's startup parameters to limit the use of memory:-xx:-usegcoverheadlimit