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.

link|improve this question

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 9 '11 at 19:59
feedback

2 Answers

up vote 6 down vote accepted

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.

link|improve this answer
feedback

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.

link|improve this answer
feedback

Your Answer

 
or
required, but never shown

Not the answer you're looking for? Browse other questions tagged or ask your own question.