It definitely does not work if you put this parameter in a jnlp file. There is a list of allowed options, and the rest will be ignored. You can check the list of available JVM parameters in the documentation .
Note that the idea is that the end user will run your application on his computer. What would you do with a bunch of heaps on your computer? Perhaps someone in the world is launching your application. This doesn't make much sense if you are allowed to do this using the JVM end users through your JNLP file.
The only situation I can think of is access to this computer, and you can check the dump later. In this case (you, as an end user, request a dump), it is really possible if you bypass the autorun of the jnlp file from the browser and run it yourself using the javaws . The steps that I took and which led to success were as follows (suppose the jnlp file was testOOM.jnlp and you are on the windows):
- Download the JNLP file
- from the command line, go to the directory with the JNLP file
- execute
javaws -verbose -J-XX:+HeapDumpOnOutOfMemoryError testOOM.jnlp
Using this application will be launched in the same way as in the browser. But pay attention to the -J , which allows you to provide JVM options for JVM. This is normal because the ebd user client requested a dump.
In OutOfMemoryError heap dump will be saved in the same directory where you run the javaws command.
Jan Zyka
source share