Alex Rivera | Logout

Why does heap space run out only when running JUnit tests?

Asked 2009-03-25T11:15:33.883
33

When running JUnit tests, I always seem to run into this error:

eclipse outOfMemoryError: heap space

I have monitored Eclipse with JConsole and heap memory peaks at about 150MB. I have set heap memory to 1GB.

I am using the following arguments when starting Eclipse:

-vm "C:\Program Files\Java\jre1.5.0_08\bin\javaw.exe" -vmargs -Xmx1024M
-XX:MaxPermSize=128M -Dcom.sun.management.jmxremote.port=8999
-Dcom.sun.management.jmxremote.ssl=false
-Dcom.sun.management.jmxremote.authenticate=false

Does anyone know what may be causing this issue? It happens only when running JUnit tests.

Edit
Report

1 Answer

2

I've just released a plugin for Eclipse that will automatically set the heap size on JUnit launchers for you. You can get it from http://code.google.com/p/junitlaunchfixer/ It works with Eclipse Europa, Ganymede and Galileo.

answered 2009-09-22T22:11:16.307

Your Answer