We are reading data from the excel file using Apachi POI, It has 800 rows of input data for our Selenium automation testcases. We have configured using jenkins and executed the batch jobs and it was working fine for more than a year . but now it shows error that "Exception in thread "main" java.lang.OutOfMemoryError: GC overhead limit exceeded". when we increase the JVM memory size as 1024 MB it is working fine. The excel file size is only 68KB. but it shows GC error. Could you please help us what is the cause of the issue . how we can give the pemanent fix for the issue .
- Total rows in the excel sheet is 800
- excel sheet file size is 68KB
Getting error message as:
Exception in thread "main" java.lang.OutOfMemoryError: GC overhead limit exceeded".
Please find the attached screenshot for the refrence enter image description here
This error message...
...implies that your program/script is busy in garbage collection and JVM is unable to perform any further task.
As per
Excessive GC Time and OutOfMemoryError
OutOfMemoryError error is raised by the JVM if 98% of the total time is spent in garbage collection and less than 2% of the heap memory is recovered. This error is raised to prevent applications from running for an extended period of time while making no progress in absence of heap memory.Solution
Turn off the feature which shows this error message by adding an option through the command line as:
Increase the heap size through the command line as:
Fine tune the Concurrent Collection through the command line as:
Enable the incremental mode:
Enable automatic pacing:
Finally, ensure that there are no Memory Leaks in your program.
You can find a detailed discussion in Error java.lang.OutOfMemoryError: GC overhead limit exceeded