There are -Xmx and max-heap-size (jnlp) options to set maximum memory java application can use.
If these options are not specified application is permitted to use only small amount of available phisical memory in the system.
That is the reason people play with -Xmx to allow application to use more memory. But this is really a nightmare as for me because there could be different amont of memory on client machine and even OS should be taken into consideration.
Is there any way to alow java application to use maximum available memory in the system?
Thanks.
By default, the HotSpot JVM will use up to 240MB. If the code cache is too small the JIT will run out of space to store its output and performance will suffer as a result. If the cache is too large, memory may be wasted.
Java is also a very high-level Object-Oriented programming language (OOP) which means that while the application code itself is much easier to maintain, the objects that are instantiated will use that much more memory.
Java consumes memory more than Xmx argument.
-XX:DefaultMaxRAMFraction=1
bugs.sun.com
Sun's 1.5 JVM
Default Heap Size
Doesn't work for web start.
Unfortunately, the best way I'm aware of is to write a simple launcher (possibly a shell script or batch file) that inspects the system, determines an appropriate value for -Xmx, and then launches the Java application. Once the JVM has initialized, it is not possible to change the values.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With