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

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,440 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, 2020 in Java by Niroj
• 82,780 points
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 Jun 3, 2020 in Java by Niroj
• 82,780 points
0 votes
1 answer

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

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

answered Jun 3, 2020 in Java by Niroj
• 82,780 points
0 votes
1 answer
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,620 points
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,900 points
+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,350 points
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,630 points
+12 votes
13 answers

Default parameters of XMS and XMX in JVM

Run this code to see all the ...READ MORE

answered Nov 13, 2018 in Java by anonymous