title: Fixing out-of-memory in Jenkins with quality plugins
body: <p>What I do know is that my Jenkins tanked last night while I was installing and configuring quality plugins with an existing job. At first the job appeared to hang, then the server itself became non-responsive. The last lines from the job console were:</p>
  
  <pre><code>[INFO] Generating "Project Team" report    --- maven-project-info-reports-plugin:2.7
  [INFO] Generating "Project Summary" report    --- maven-project-info-reports-plugin:2.7
  [INFO] Generating "Dependencies" report    --- maven-project-info-reports-plugin:2.7
  [CHECKSTYLE] Parsing file /var/lib/jenkins/jobs/fedsso-dev/workspace/target/checkstyle-result.xml
  [CHECKSTYLE] Successfully parsed file /var/lib/jenkins/jobs/fedsso-dev/workspace/target/checkstyle-result.xml of module mdlive-sso with 9924 warnings.
  FATAL: PermGen space
  FATAL: PermGen space
  Finished: null
  </code></pre>
  
  <p>At this point the server was out in the woods and I couldn't even stop it with <code>server jenkins stop</code>, having to <code>kill -9</code> the process.</p>
  
  <p>It looks like something ran out of memory, but I am new to getting Jenkins, Maven and plugins to play nice. The <code>/etc/default/jenkins</code> file does not specify a JVM heap size so I think it is using default which I believe would be 256MB, but the Jenkins process in <code>top</code> was running with over 2GB of virtual memory. I understand from <a href="https://wiki.jenkins-ci.org/display/JENKINS/Builds+failing+with+OutOfMemoryErrors" rel="nofollow">https://wiki.jenkins-ci.org/display/JENKINS/Builds+failing+with+OutOfMemoryErrors</a> that I should consider the perm size as well (which looks like it is related to "FATAL: PermGen space") and also the maven task memory.</p>
  
  <p>The VM host I am running on has been set up with 7GB of memory and the machine is dedicated to Jenkins and hopefully a future install of SonarQube so I have some room to change memory settigns. Can someone help me make some sense of out the memory settings to make Jenkins and its plugins happy?</p>