This blog has moved to
http://blog.matthias-reining.com

Die bestehenden Artikel bleiben vorerst alle bei blogspot. Neue Artikel veröffentliche ich allerdings nur noch auf http://blog.matthias-reining.com

Montag, 2. November 2009

Findbugs und Out of memory


Innerhalb meines Continous Integration Systems (hudson) werden per ANT auch potentielle Fehler per Findbugs ermittelt. Hierzu wird folgendes Target innerhalb des ANT Skriptes defniert:


name="findbugs" classname="edu.umd.cs.findbugs.anttask.FindBugsTask">
       refid="findbugs.class.path" />



name="run-findbugs">
      run findbugs (findbugs home: ${env.FINDBUGS_HOME})
       dir="${findbugs.report.dir}" />
       dir="${findbugs.report.dir}" />
       home="ext/findbugs-1.3.9-rc1" output="xml:withMessages" outputFile="${findbugs.report.dir}/findbugs_vger.xml">
             location="${build.jar.dir}" />
             refid="build.class.path" />
             path="${src.dir}" />
      


Allerdings tritt bei größeren Sourcecode Analysen ein Out of memory Fehler auf:
[findbugs] Executing findbugs from ant task
[findbugs] Running FindBugs...
[findbugs] Out of memory
[findbugs] Total memory: 66M
[findbugs]  free memory: 0M

Findbugs forkt den Prozess und macht eine neue JVM Instanz auf, weshalb eine Speichererhöhung innerhalb des Findbugs-Tags stattfinden muss:
  home="ext/findbugs-1.3.9-rc1" jvmargs="-server -Xmx256m" ...