java.lang.OutOfMemoryError: GC overhead limit exceeded

Searched on Google with the first line of a JAVA stack trace?

We can recommend more relevant solutions and speed up debugging when you paste your entire stack trace with the exception message. Try a sample exception.

Recommended solutions based on your search

Samebug tips

,
via oracle.com by Unknown author

An easy way to solve OutOfMemoryError in java is to increase the maximum heap size by using JVM options -Xmx512M, this will immediately solve your OutOfMemoryError.

,
via Stack Overflow by Eugene Yokota

In Eclipse : go to Run --> Run Configurations --> then select the project under maven build --> then select the tab "JRE" --> then enter -Xmx1024m

This should increase the memory heap for all the builds/projects. The above memory size is 1 GB

Solutions on the web

via Stack Overflow by Knows Not Much
, 1 year ago
via nabble.com by Unknown author, 1 year ago
via netbeans.org by Unknown author, 1 year ago
via GitHub by donghwan-shin
, 1 year ago
GC overhead limit exceeded
via GitHub by benoitgaudou
, 10 months ago
Requested array size exceeds VM limit
java.lang.OutOfMemoryError: GC overhead limit exceeded
at java.util.Arrays.copyOf(Unknown Source)
at java.lang.AbstractStringBuilder.expandCapacity(Unknown Source)
at java.lang.AbstractStringBuilder.ensureCapacityInternal(Unknown Source)
at java.lang.AbstractStringBuilder.append(Unknown Source)
at java.lang.StringBuilder.append(Unknown Source)
at java.lang.reflect.Method.specificToStringHeader(Unknown Source)
at java.lang.reflect.Executable.sharedToString(Unknown Source)
at org.junit.internal.MethodSorter$2.compare(MethodSorter.java:33)
at org.junit.internal.MethodSorter$2.compare(MethodSorter.java:28)
at org.junit.internal.MethodSorter$1.compare(MethodSorter.java:20)
at java.util.TimSort.countRunAndMakeAscending(Unknown Source)
at java.util.TimSort.sort(Unknown Source)
at java.util.Arrays.sort(Unknown Source)
at org.junit.internal.MethodSorter.getDeclaredMethods(MethodSorter.java:56)
at org.junit.runners.model.TestClass.scanAnnotatedMembers(TestClass.java:65)
at org.junit.runners.model.TestClass.(TestClass.java:57)
at org.junit.runners.ParentRunner.createTestClass(ParentRunner.java:88)
at org.junit.runners.ParentRunner.(ParentRunner.java:83)
at org.junit.runners.BlockJUnit4ClassRunner.(BlockJUnit4ClassRunner.java:65)
at org.junit.runners.parameterized.BlockJUnit4ClassRunnerWithParameters.(BlockJUnit4ClassRunnerWithParameters.java:27)
at org.junit.runners.parameterized.BlockJUnit4ClassRunnerWithParametersFactory.createRunnerForTestWithParameters(BlockJUnit4ClassRunnerWithParametersFactory.java:16)
at org.junit.runners.Parameterized.createRunnersForParameters(Parameterized.java:313)
at org.junit.runners.Parameterized.(Parameterized.java:248)
at pps.test.Parallelized.(Parallelized.java:50)
at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
at sun.reflect.NativeConstructorAccessorImpl.newInstance(Unknown Source)
at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(Unknown Source)
at org.junit.internal.builders.AnnotatedBuilder.buildRunner(AnnotatedBuilder.java:104)

Users with the same issue

22 times, 4 days ago
Once, 1 week ago
Once, 3 weeks ago
2 times, 1 month ago
Once, 2 months ago
53 more bugmates

Know the solutions? Share your knowledge to help other developers to debug faster.