I am running a Junit test which throws an exception OutOfMemory. The test is started inside NetBeans 6.9.X. When profiling it I've realized that the Heap maxSize is 64M. I would like to increment this but I couldn't find how to do this.
I already tried right click at the project ->properties ->Run and under the VM options I've set -Xms300M but this didn't work.
Any hint?
Thanks in advance.
Junit tests are run in a different vm as the Ee IDE. So it is that vm that is out of memory and not the Ee one. You can change the settings of the test vm in the run configurations of the test. You go to the run configurations and then under arguments, you can set the vm arguments.
How to fix it: In some cases, to mitigate the problem, it is enough to increase the maximum heap size by adding the -Xmx to your JVM application startup settings and setting it to a larger value.
From http://wiki.gephi.org/index.php/NetBeans_Tips#How_to_increase_Heap_Size_for_JUnit_test
Edit your project.properties file and add the line:
test.run.args=-Xms128m -Xmx1400m
You can also increase the max size for all VMs by setting this environment variable for your OS:
_JAVA_OPTIONS=-Xmx300m
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With