Skip to Main Content

Java HotSpot Virtual Machine

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

Increasing max heap size at runtime?

835647Jan 31 2011 — edited Feb 1 2011
For my java application I set the max heap size with the jnlp
attribute max-heap-size.

The user may specify the amount of memory in a text-field of the html
page that launches the application.

The problem is that it is hard to predict, how much memory is
needed. I neither know the availability of RAM in the client PC
nor the requirement for the user. The users of my programs
could manually adjust the amount, but they are usually not IT specialists
and probably do not have a clue about memory amounts. They may
have big or small computers.

I would rather prefer not to decide for a fixed limit at program start.
Instead I would suggest that in case the heap exceeds the limit, the JVM
would pause and the user could have the option to hot-plug
more memory into the JVM or to kill the JVM.

After intensive Web searching it seams to me, that this is not
yet possible. Which is surprising since hot-plugging
resources (HD, RAM, CPUs) is almost a standard feature of
virtualization platforms. There are tools in the JDK which act
upon a running JVM, but I have not spotted anything that could
change the heap size at runtime.


I found a discouraging link here:

http://stackoverflow.com/questions/3358328/why-does-the-sun-jvm-have-a-fixed-upper-limit-for-memory-usage-xmx

Do you have any ideas how to adapt the max heap size to the requirement of the user?
Perhaps in the comming jdk 1.7?
Thanks

Christoph
Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on Mar 1 2011
Added on Jan 31 2011
4 comments
1,251 views