Disabling maximum Java heap size
843829Sep 28 2005 — edited Sep 28 2005Unless someone can convince me otherwise, I'd like to completely disable the maximum heap size. I only want to get an OutOfMemoryError when the underlying OS (Windows in my case) has no memory left!
Is there a way to do this? Or do I have to do something like java -Xmx1688207360, which is the biggest value I can use on my box without getting
Error occurred during initialization of VM
Could not reserve enough space for object heap
Could not create the Java virtual machine.
The reason I want to do this is that I use a lot of DirectByteBuffers, and now the JVM keeps track of how much it's using and will throw an OutOfMemoryError should I attempt to exceed this limit.
So I have to use either the -Xmx option or the -XX:MaxDirectMemorySize to increase these settings, and I'm trying to come up with a limit when really the only limit I can perceive is the physical limitation of the server.
The software will be running on server class machines with no less than 1GB of physical RAM.
I don't even understand the motivation for having a maximum heap size?