Page 1 of 1

[SOLVED] Reduce memory footprint through javaws.vmoptions?

Posted: 12 Oct 2020, 16:47
by steffenrh

I'm trying to reduce the memory footprint of OpenWebStart by tweaking the VM parameters. For example, when starting with no custom parameters, the javaws.exe consumes ~500-600MB of memory on a 16GB System. On a Windows terminalserver with 80GB of RAM and 64GB pagefile we can even see ~ 1.4GB memory allocation by javaws.exe. :(

For testing purpose I've added the following options to C:\Program Files\OpenWebStart\javaws.vmoptions :


With the next start of a web start application, I can see that the Private Bytes footprint (Sysinternals Process Explorer 64) of javaws.exe has dropped down to ~ 120 MB, after a while stabilizing at ~ 180MB. VisualVM shows me, that 64MB heap size are more than enough to run javaws.exe. On the 80GB terminal server it stabilizes at ~ 250MB, which is still more than 1GB less RAM wasted.

We also edited our application's JNLP files to contain java-vm-args="-Xms128m -XX:+UseG1GC -XX:MaxHeapFreeRatio=40", among other options given in this attribute. This reduced the memory footprint of the started application by around 75%. We don't see any negative impact until now. Also here VisualVM shows sufficient free heap space available, and if necessary, the application may allocate more.

I think the problem is, that the Java VM sets the initial heap size depending on the RAM it sees on the system at init phase. Much RAM = big initial heap size, no matter how much really is required. Maybe that's acceptable on a single user system, but on a Windows terminal server this is a No Go. Therefore we try to minimize the initial memory footprints, fully aware that in rare cases, where the application really needs more memory, we'll lose some millisecs for the memory allocation.

Question: Does anyone have similar results with minimizing the memory footprint? Do you think there are risks when configuring like shown above?

cu, Steffen

Re: Reduce memory footprint through javaws.vmoptions?

Posted: 15 Oct 2020, 18:15
by Janak Mulani
Hello Steffen,

For running OWS using the bundled jre with a smaller memory footprint what you are doing is correct, i.e. specifying jvm args in javaws.vmoptions.

For running the application using the preferred JVM with smaller memory footprint it is correct to specify appropriate jvm args in the jnlp file. OWS will apply these args to the JVM that starts the application specified in the jnlp file.

We will experiment with this further and investigate if we can specify built in JVM args to start javaws with the bundled jre with minimum possible initial memory footprint.

Thanks for reporting this issue.


Re: Reduce memory footprint through javaws.vmoptions?

Posted: 30 Oct 2020, 11:18
by Janak Mulani
Hello Steffen,

This will be fixed in v 1.3.0 to be released in November. The bundled JVM will be started with arg -Xms64m.

Thanks for reporting this issue.

- Janak