Question

I am creating a control panel for java based game servers and wanted to kno how to assign all available system memory for the jvm. So, instead of just using say -Xmx512M, i would use a flag that will automatically assign all the system memory.

I know it is not recommended to assign all of the memory but I just want to do it.

Was it helpful?

Solution

If you use something like Waratek JVM you will be able to hook into the api or MBeans to control it.

See http://www.waratek.com/

BTW when allocating memory, the JVM will look to use contiguous memory otherwise it will fail, so even though you have 100MB free, unless it is contiguous you may not be able to use it all.

OTHER TIPS

Using Sun's JVM this is not possible, there always has to be an upper limit to the amount of memory that can be assigned. This protects the host operating system and ultimately makes applications perform better.

Performance-wise you're often better off using a smaller amount of memory well than having loads available to you that you might not need.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top