Java exception: Java.lang.OutOfMemoryError:GC overhead limit exceeded

Source: Internet
Author: User
Tags garbage collection gc overhead limit exceeded

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

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.