It may already be something you tried, but ... if you use your unit tests like "JUnit plug-in tests" ... then your settings for Xmx and MaxPermSize in eclispe.ini are useless.
The eclipse.ini options let you change the settings for the current Eclipse. Any Eclipse instance created from this Eclipse will still have default settings (something like Xms40m and Xmx512m). You must also change them.
Open the launch configuration that you use for your tests (Run> Run Configurations ..., select the one you use to run unit tests) and go to the "Arguments" tab. There, in the โVM Argumentsโ text area, enter the new memory parameters, as in the eclipse.ini file (I use -Xms256m -Xmx1536m -XX:MaxPermSize=256m for the most expensive test suites ... but you may need more).
A major issue may be trying to fix potential memory leaks in your unit tests. Are you sure there is no more unloading / freeing memory / ... in tearDown() ? Running tests on profiling can help (we use the Mykit java profiler for this purpose, where I work ... but it is not free. JConsole can help you, see also http://java.sun.com/developer/technicalArticles/ J2SE / jconsole.html ).
source share