How to give Java run time more heap space?
5,890
Solution 1
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.
Solution 2
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.
Related videos on Youtube
Author by
WilliamKF
Updated on September 18, 2022Comments
-
WilliamKF almost 2 years
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.