java.lang.OutOfMemoryError: GC overhead limit exceeded Error

0 votes

Can someone explain what is “GC overhead limit” in the below error:

java.lang.OutOfMemoryError: GC overhead limit exceeded

Also, please do explain how to get rid of it. Thanks in advance.

May 31, 2018 in Java by anto.trigg4
• 3,440 points
2,381 views

1 answer to this question.

0 votes

This simply means that for some reason garbage collector is consuming an excessive amount of time. For example, 98% of CPU time is spent on GC and less than 2% of the heap is recovered. This technically means your program stops making any progress and just executes the garbage collector. Thus in order to let you diagnose this error and prevent the applications from running for an extended period, JVM throws this error.

You can prevent this error, by following any of the below:

  1. Increasing the heap size, for e.g: -Xmx1g

  2. Enabling the concurrent low pause collector -XX:+UseConcMarkSweepGC

  3. Reusing the existing objects when possible to save some memory

Hope this helps!!

answered May 31, 2018 by misc.edu04
• 1,430 points

Related Questions In Java

0 votes
1 answer

Error:“java.lang.OutOfMemoryError: Java heap space” ?

Hii, Possible causes: Simple configuration issue, where the specified ...READ MORE

answered Apr 8 in Java by Niroj
• 23,950 points
59 views
0 votes
1 answer

Error:“java.lang.OutOfMemoryError: PermGen space” in Maven build

Hello @kartik, When you increased MAVEN_OPTS, you increase the MaxPermSize, ...READ MORE

answered 2 days ago in Java by Niroj
• 23,950 points
13 views
0 votes
1 answer

Error:java.lang.OutOfMemoryError: Java heap space in Maven

Hello @kartik, Here is the whole config that ...READ MORE

answered 2 days ago in Java by Niroj
• 23,950 points
19 views
0 votes
1 answer

Following error is occurring "Can't start Eclipse - Java was started but returned exit code=13"

There are combinations of Operating System, JDK ...READ MORE

answered Apr 19, 2018 in Java by Rishabh
• 3,580 points
1,296 views
0 votes
2 answers

How can I solve java.lang.NoClassDefFoundError in Java?

NoClassDefFoundError means that the class is present ...READ MORE

answered Sep 11, 2018 in Java by Sushmita
• 6,890 points
2,862 views
0 votes
1 answer

Fixing java.lang.UnsupportedClassVersionError in Java

To fix the exception/ error, you should ...READ MORE

answered Jun 7, 2018 in Java by sharth
• 3,370 points
217 views
+1 vote
1 answer

How can we resolve java.lang.OutOfMemoryError in Java?

Work with smaller batches of HashMap Objects ...READ MORE

answered Jun 5, 2018 in Java by sharth
• 3,370 points
126 views
0 votes
0 answers
0 votes
1 answer

Is it possible to create a memory leak with Java

Here's a good way to create a memory ...READ MORE

answered May 30, 2018 in Java by Parth
• 4,640 points
1,132 views
+10 votes
12 answers

Default parameters of XMS and XMX in JVM

You use these Java command-line parameters to ...READ MORE

answered Nov 13, 2018 in Java by Murali
218,081 views