So – jnlp files can request heap memory size thusly:
<j2se version="1.6+" href="blah" max-heap-size="1g"/>
1 gigabyte is a lot of memory for a web based app to ask for isn’t it, but alas some (not all) of the tasks the user might want to do with my app require that much memory.
Problem is, if you request a larger max-heap-size than the jvm wants to allow, it just fails, silently. Oops.
The first thing I don’t know is how the jvm decides what the maximum allowable max-heap-size is. Presumably it depends on the available memory?
Assuming this is the case, is there a way I can test how much memory is available on the client and only request a large max-heap-size if it can handle it? Less capable clients can just run with a smaller heap and lose a bit of functionality.
I don’t think so. (Having your server inquire how much memory the user’s PC has would be a potential security issue … )
I think that the best you can do is to offer users multiple JNLP links with different heap sizes, and allow them to chose between them.