Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to debug and tune the memory settings of my jenkins maven build

I have a CI System setup based on Jenkins on a Windows 2003 server box (8cores, 16GB 8 of which are on 'standby' according to the Resource Monitor). There are two main jobs configured, both based on multi module projects.

I suspecting that the build performance could be improved by tweaking the memory settings (-xmx) of the builds. But there are just to many places to configure stuff and not enough places to monitor success. So my questions are:

  • How can I connect with JConsole, or JVisualVm with jenkins and the build jobs, in order to analyze what it is going on in memory.

  • What are the default settings of jenkins for maximum heap size

  • What are the default settings of maven for maximum heap size

  • What might be reasonably values for such a setup

  • What is the best way to change these settings.

  • What other settings should I look into?

like image 379
Jens Schauder Avatar asked May 06 '11 13:05

Jens Schauder


2 Answers

Jenkins uses the default VM settings if you have started Jenkins via java -jar jenkins.war otherwise if you started jenkins via Tomcat etc. the defaults are coming via Tomcat (Jetty or whatever). In tomcat you can set JAVA_OPTS before Tomcat starts to define things like this.

Furthermore the settings for Maven can be controled by MAVEN_OPTS environment variable which can be set for each build in Jenkins as well. Take a look into the Job configuration for you job. The reasonably values for such setup depend on what your build does which i don't know.

like image 88
khmarbaise Avatar answered Sep 25 '22 18:09

khmarbaise


If you install Jenkins monitoring https://wiki.jenkins-ci.org/display/JENKINS/Monitoring via Manage Jenkins / Plugin Manager then it is easy to get memory usage information via the Javamelody http://code.google.com/p/javamelody/ plugin.

like image 44
Mark Butler Avatar answered Sep 24 '22 18:09

Mark Butler