JVM Maximum Heap Size Problem
Is there a pure Java solution that let us dynamically change the maximum heap size required?
The reason that I am asking is because the GUI program that I wrote works in many situations. The key problem is that the data users load can range from 10MB to 4GB. Most people who uses the GUI application has 512MB to 1GB memory, but we also need to use this program on 64-bit Solaris to visualize some of the high resolution data. We have no way in advance to guess the size of the data users will load.
Currently, I am using a stub main that re-launches the program with fix maximum 800m request. Apparently, this request works in most situations, even on people with 512MB memory. However, the drawback is the long delayed start up time. We also have to tell people trying to load larger data on 64-bit machine the specific commands they need to use to launch the application. Requesting memories larger than 1GB on Windows machine with 2-4GB ram is a matter of trial and error even if JVM reports to have much larger physical rams. The matter is further complicated when the application is launched with in WebStart with full permission since the memory reported is much less than what actually is available.
So the question is, is there a better way to solve this problem?
Thanks

