Could not reserve enough space for object heap
843811Jun 1 2005 — edited Jan 29 2010I'm have installed java 1.5 on a virtual private server. If I ran java, I would get this error:
Error occurred during initialization of VM
Could not reserve enough space for object heap
Could not create the Java virtual machine.
I find a post about it and fixed it by just adding the flags "-Xms64m -Xmx512m". The problem is with javac now. No matter if I had "-Xms64m -Xmx512m" or not, I still get the same exact error.
Here is some information that I found that might help out that someone else got from tech support:
The memory allocation that is reported by the top and free commands is indicative of the memory that is not already allocated for use by the controlling kernel on the virtual host. The memory on the machine will be dynamically allocated to the individual instances by the super daemon as needed. This is why the machine appears to have no RAM free.
However, you will need to limit the amount of RAM that the JVM attempts to allocate upon startup. This is because the JVM is a bit greedy on startup and will attempt to allocate all RAM available to it. As the RAM available to your instance is shared with the other instances on the machine, this request is denied by the kernel.