Programmers learn & share
0 votes

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 | 84 views

1 Answer

0 votes


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 


Further Readings:

by (36.1k points)  
edited by
2,227 questions
2,734 answers
241 users