Could not reserve enough space for object heap

Narendra picture Narendra · Dec 9, 2010 · Viewed 1M times · Source

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?

Answer

Bozho picture Bozho · Dec 9, 2010

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