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
4,282 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,450 points

Related Questions In Java

0 votes
0 answers

Error java.lang.OutOfMemoryError: GC overhead limit exceeded

When I execute my JUnit tests I am getting ...READ MORE

May 15, 2022 in Java by Kichu
• 19,050 points
390 views
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,880 points
929 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 Jun 3, 2020 in Java by Niroj
• 82,880 points
1,438 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 Jun 3, 2020 in Java by Niroj
• 82,880 points
12,129 views
0 votes
1 answer

Error:java.lang.UnsupportedClassVersionError: Unsupported major.minor version

Hello @kartik, This error means you're trying to ...READ MORE

answered Jul 28, 2020 in Java by Niroj
• 82,880 points
1,392 views
0 votes
0 answers

Exception in thread "main" java.lang.Error: Unresolved compilation problems

I am facing issues importing classes and ...READ MORE

May 7, 2022 in Java by narikkadan
• 63,420 points
4,899 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
828 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 31, 2018 in Java by Parth
• 4,630 points
2,100 views
+10 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
397,417 views
webinar REGISTER FOR FREE WEBINAR X
REGISTER NOW
webinar_success Thank you for registering Join Edureka Meetup community for 100+ Free Webinars each month JOIN MEETUP GROUP