Troubleshooting problems encountered with Java VM.

java.lang.OutOfMemoryError: Java heap space

Java VM runs out of memory.  There are two possible causes of this: memory leak, or the application you are running requires more memory.

Resolution

For the case that your application needs more memory, add the following argument when running your application:

  • -Xmx<maximum heap size>

For example, to set the maximum heap size to 512 MB:

  • -Xmx512m