Why you’re getting this error?
It’s an alert from JVM and this generally means that, for some reason, the GC spends excessive amount of time – by default, 98% of the total CPU time spent for the process – and is able to recover very little memory – less than 2% of the heap.
What to do to resolve this exception?
If you’re executing your own code, you’ve got a tough job at hand – to review your code.
1. You’re probably creating lots of temporary objects in a loop; See if created object(s) can be reused.
2. If it’s a genuine requirement, try increasing the max heap size (XmX) in JVM arguments.
I don’t want JVM to throw this alert. Can I disable it?
You can turn this off with the command line option -XX:-UseGCOverheadLimit