Jenkins java.lang.OutOfMemoryError: GC overhead limit exceeded

Prashanth K picture Prashanth K · Jan 5, 2017 · Viewed 12.7k times · Source

I am currently working on creating a performance framework using jenkins and execute the performance test from Jenkins. I am using https://github.com/jmeter-maven-plugin/jmeter-maven-plugin this plugin. The sanity test with single user in this performance framework worked well and went ahead with an actual performance test of 200 users and within 2 mins received the error java.lang.OutOfMemoryError: GC overhead limit exceeded I tried the following in jenkins.xml

<arguments>-Xrs -Xmx2048m -XX:MaxPermSize=512m -Dhudson.lifecycle=hudson.lifecycle.WindowsServiceLifecycle -jar "%BASE%\jenkins.war" --httpPort=8080 --prefix=/jenkins --webroot="%BASE%\war"</arguments>

but it didn't work and also noted that whenever I increased the memory the jenkins service stops and had to reduce the memory to 1Gb and then the service restarts.

Had increased the memory for jmeter and java as well but no help. In the .jmx file view results tree and every other listener is disabled but still the issue persists.

Since I am doing a POC jenkins is hosted in my laptop and high level specs as follows System Model : Latitude E7270 Processor : Intel(R) Core(TM) i5-6300U CPU @ 2.40GHZ(4CPU's), ~2.5GHZ Memory : 8192MB RAM

Any help please ?

Answer

hardillb picture hardillb · Jan 5, 2017

The error about GC overhead implies that Jenkins is thrashing in Garbage Collection. This means it's probably spending more time doing Garbage Collection than doing useful work.

This situation normally comes about when the heap is too small for the application. With modern multi generational heap layouts it's difficult to say what exactly needs changing.

I would suggest you enable Verbose GC with the following options "-verbose:gc -XX:+PrintGCDetails -XX:+PrintGCTimeStamps"

Then follow the advice here: http://www.oracle.com/technetwork/articles/javase/gcportal-136937.html