简体   繁体   中英

Webstart application fails to start with -Xmx2G on Java 8u60

I have a Java Webstart application that starts successfully with -Xmx1G , but fails to start with -Xmx2G . Some of my users really need 2G of heap.

This seems to be a problem with Java 8u60 only, because I have a report of someone launching successfully with Java 8u51.

The failure looks like this: I see the blue 'Java...' splash screen, and then after a few seconds, poof it's gone, before displaying the Java console and without producing any trace information in the expected place.

The failure occurs only on those clients with less than 2G of memory available. But, I am a little surprised that requesting a 'maximum' heap size could cause the application to fail so early and without any diagnostic information. We are dealing with a 'maximum' value, after all, not an 'initial' value. I read in multiple places that the JVM is not supposed to do this.

But I also remembered reading that the 'initial', if unspecified, is based on the maximum. So, along with passing -Xmx2G , I tried passing -Xms512M , -Xms256M , and -Xms128M . But, this attempt to shrink the initial heap size did not help. I cannot get this thing to start with -Xmx2G !

Does anyone have any light to shed on this situation? A solution? A workaround? In the short term, I'll change to -Xmx1G , but, as I said at the beginning, I have some users that really need -Xmx2G . I'd like to avoid having two separate *.jnlp files, which would also entail having two separate *.jar files!

Turns out that this is exactly what Webstart on Java8u60 does if the client machine does not have enough memory to satisfy -Xmx . It attempts to start, and then poof , it disappears without any indication as to what went wrong.

So, I will end up having to build my application in different configurations if I want to enable the users with more memory to allocate that memory to my application. This is because signing requires the *.jnlp file to into the *.jar file itself, and this *.jnlp file must be an exact match with the *.jnlp file used to launch the application.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM