6

I am running PMD v4.2.5 on Windows 7 and it is running out of memory with the following error:

Exception in thread "Thread-4" java.lang.OutOfMemoryError: Java heap space

How can I configure the JRE to allow the process to consume more memory? I have 4 GB of RAM and would hope that is enough.

WilliamKF
  • 8,058

2 Answers2

8

Launch 'java' with -Xmx<memory> option. e.g.

java -Xmx512m ...

Use java -help to display options. The -Xmx option is a non-standard option. Use java -X to display a list of non-standard options.

SkyBeam
  • 3,832
4

If calling from the commandline add -Xmxnnnm to the commandline to set the max to nnn mb. Ex: -Xmx256m to give the heap 256 mb of memory.

uSlackr
  • 9,053