Could not reserve enough space for object heap

Total
0
Shares

I am getting the following exception repeatedly each time I try to run the program.

Error occurred during initialization of VM

Could not reserve enough space for object heap

Could not create the Java virtual machine.

I tried to increase my virtual memory (page size) and RAM size, but to no avail.

How can I eliminate this error?


Solution

Run the JVM with -XX:MaxHeapSize=512m (or any big number as you need) (or -Xmx512m for short)

Source: StackOverflow.com

Leave a Reply

Your email address will not be published. Required fields are marked *