Reputation: 35903
I got a
java.lang.OutOfMemoryError: GC overhead limit exceeded
while splitting some strings. Interestingly, neither the memory was used up nor the garbage collector was going crazy:
The exception appeared at 11:10, when Eclipse froze the program before actually throwing the exception. So everything after 11:10 may be just noise.
I repeatedly run into this issue in my long-running program but I do not know how to avoid it. Even assigning much more memory does only delay but not stop it.
Upvotes: 0
Views: 761
Reputation: 226
You are using stop-the-world GC (probably Parallel Scavenge).This exception is because GC takes too much time, which maybe more than 98% of total execution time. In this case, JVM kills the process as no real work is being done.
The solutions could be:
-XX:-UseGCOverheadLimit
, which may cause problems as JVM keeps working on GC instead of real work; -XX:+HeapDumpOnOutOfMemoryError
and analyze the trace.A little more explanation why heap is not full but GC over limit (all these are guesses, and more traces needed to make sure the causes): this can be
Upvotes: 2