Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

PermGen errors in Jenkins

I had cases of Jenkins failures and nothing but Jenkins redeployment (Jenkins is a webapp in Tomcat) helped. Even new jobs failed with PermGen space errors, but all the settings were fine (all these -XX:PermSize parameters everywhere it's possible). The point is after redeployment everything worked like a charm. But it's a harsh solution. I wanted to know, if there are some options to rollback Jenkins state. Thanks in advance.

Update: Okay, for those, who may face something like that, here is what I figured out. Those, who wrote that it's better to deploy Jenkins as a Tomcat module probably didn't face the problems of any kind of project deployment (with Jenkins Deploy plugin or with a tomcat-maven-plugin in Maven's pom.xml). I didn't have any of the problems I described when installed Jenkins separately. Whew!

like image 461
John Doe Avatar asked Jun 21 '12 11:06

John Doe


People also ask

What is PermGen error?

OutOfMemoryError: PermGen Space is a runtime error in Java which occurs when the permanent generation (PermGen) area in memory is exhausted. The PermGen area of the Java heap is used to store metadata such as class declarations, methods and object arrays.

What is JVM PermGen?

PermGen (Permanent Generation) is a special heap space separated from the main memory heap. The JVM keeps track of loaded class metadata in the PermGen. Additionally, the JVM stores all the static content in this memory section.

Is removal of PermGen introduced in Java 8?

Due to the above problems, PermGen has been completely removed in Java 8. In the place of PermGen, a new feature called Meta Space has been introduced. MetaSpace grows automatically by default. Here, the garbage collection is automatically triggered when the class metadata usage reaches its maximum metaspace size.

How do I set PermGen space in eclipse?

Open eclipse. ini file, it is located in root eclipse directory. there you can change -Xms and -Xmx parameter to change permgen size. There you can change -XX:PermSize and -XX:MaxPermSize.


1 Answers

The one setting that really matters for PermGen space errors is (and it must be this exactly):

-XX:MaxPermSize=512m

One dash, two Big Xs, Big-M, Big-P, Big-S, no-spaces, size-in-megs, lower case m. If you screw it up it will be ignored. 99% of all the PermGen fixes I see that "don't work" are because someone didn't follow instructions precisely and used a Big-M for megabytes instead of a little-m, or put two dashes in front instead of one for example.

Also, 512 megs is just a starting point... adjust to fit your system.

like image 66
Matt Brock Avatar answered Oct 13 '22 07:10

Matt Brock