I wrote a program in Java 1.6 and JavaFX 1.3 that used UseParallelGC. I could tell that it was using this GC mode because VisualVM would show constant memory usage. Other GC modes would show memory go up and back down again. The only other one that came close to having near constant memory usage was UseConcMarkSweepGC, but even that one had small hills. The program was a video game so I was looking for near 0 GC delay.
Fast fwd to the present. I rewrote my program in Java 7 and JavaFX 2.x. But now the UseParallelGC VM option does not do anything noticeable, looks like it is using the default GC mode. When I set the GC mode to UseConcMarkSweepGC then the VisualVM output looks like it did in the 1.6 version (small hills). So I can tell that I was setting the JVM arguments correctly.
Here is the JNLP attribute for VM arguments.
- for UseParallelGC....
java-vm-args="-ea -XX:+UseParallelGC -Dprism.dirtyopts=false "
- for UseConcMarkSweepGC....
java-vm-args="-ea -XX:+UseConcMarkSweepGC -Dprism.dirtyopts=false "
In Java 7 is UseParallelGC still supported and if not is there an alternative?
Thank you in advance for any help you may provide.
UseParallelGC might have no effect if it happens to be the default in your computer. Java looks at the computer and uses what it thinks of as reasonable defaults for things. To see default switches in your computer try this:
java -XX:+PrintCommandLineFlags -version
You could also try the new G1 collector, it should be good for some types of applications. Google for "Java 7" G1 or java garbage first.
sja, thank you for your response!
It looks like the new G1 collector is working good but I cannot tell if the Java WebStart accepts it because it is not listed as an acceptable value to the jvm-args attribute... http://docs.oracle.com/javase/7/docs/technotes/guides/javaws/developersguide/syntax.html#resources
Can someone confirm if -XX:+UseG1GC is settable via the JNLP file?