• Register
0 votes
73 views

Problem :

I am getting bellow error while I execute my JUnit tests

exception in thread "main" java.lang.outofmemoryerror: gc overhead limit exceeded

by (6.9k points)  
edited by

1 Answer

0 votes

Solution: 

The Garbage Collector throws this exception when a lot of time is spent in garbage collection for very small return, e.g. 98% of CPU time spent on GC and 2% of heap is recovered.

The purpose behind this feature's designe is to prevent applications from running for an longer period of time while making very little or no progress because the heap is too small.

One can turn this feature off with the command line option 

-XX:-UseGCOverheadLimit

Further Readings:

https://github.com/rdfhdt/hdt-java/issues/58

by (36.1k points)  
edited by
...