Our application ideally runs with a 2GB heap, but can run slower with a 1GB heap if the user only has a 32bit JRE (1GB being the maximum this supports).
Currently, we use the browser's user-agent field to detect if the browser is 64bit, and if so we generate the JNLP on the fly to specify a max heap of 2GB. 32bit browsers get MaxHeap=1GB, and accordingly our application doesn't perform as well.
We have realised that we have an issue because detecting a 64bit OS and browser does not mean the user necessarily has a 64bit JRE installed. The 32bit JVM crashes on startup if you specify a max heap size in excess of 1GB.
The only way to specify the JVM memory settings is via the arguments in the JNLP, hence us trying to rewrite it as we serve it out. But we know don't think the server has a reliable method of doing this. Has anyone had the same problem, and come up with a solution?