Reputation: 20966
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.
Upvotes: 5
Views: 739
Reputation: 20966
-XX:DefaultMaxRAMFraction=1
Doesn't work for web start.
Upvotes: 5
Reputation: 38526
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.
Upvotes: 3