> java -XX:+UnlockExperimentalVMOptions -XX:+UseG1GC Another args...
If you want to use G1GC commonly, set these VM args to environment variable JAVA_OPTS.
JAVA_OPTS="-XX:+UnlockExperimentalVMOptions -XX:+UseG1GC"
> java $JAVA_OPTS Another args...
Another advantage to set JAVA_OPTS is that other Java programs often reads and uses this environment variable, e.g. tomcat, JRuby and so forth.
No comments:
Post a Comment