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
  • 7,778
  • 34
  • 103
  • 145
  • I don't know the correct answer, but I heard that 64bit JRE in some cases fixes the problem, so try it out. – AndrejaKo May 09 '11 at 19:59

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,812
  • 17
  • 16
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
  • 8,955
  • 31
  • 48