java7 G1 Options

2019-05-10 20:00发布

I can't find any options relating to how G1 operates. The below two commands no longer work with java7.

-XX:+G1ParallelRSetUpdatingEnabled 
-XX:+G1ParallelRSetScanningEnabled 

标签: java g1gc
2条回答
The star\"
2楼-- · 2019-05-10 20:10

Only options I am aware of that have an impact on G1 are:

  • to activate:

    -XX:+UnlockExperimentalVMOptions -XX:+UseG1GC

  • to set the max GC pause time goal in milliseconds that G1 will attempt to meet:

    -XX:MaxGCPauseMillis=<X>

  • to set the time interval over which GC pauses totaling up to MaxGCPauseMillis may take place:

    -XX:GCPauseIntervalMillis=<X>

  • to set the size of the young generationto impact evacuation pause times:

    -XX:+G1YoungGenSize=512m (also disabled in some versions)

  • to set the (not specific to G1 only) survivor spaces' size

    -XX:SurvivorRatio=6 (and other survivor-related options)

Quick Warning

Be warned that all -XX options types are deemed experimental and subject to change at any time (so, usually not stuff you want to stick in the .{bat,sh}, wrapper.conf script or config file used to jump-start your enterprise application.

They are pretty useful, but not to rely on too much if you want a stable and durable launcher.


The 2 options you mentioned, while originally available at the time of G1's first public release in the course of Java SE 6 Updates, have now been deprecated. So has G1YoungGenSize in some versions.


Sources:

查看更多
何必那么认真
3楼-- · 2019-05-10 20:23

Java 7 update 4 now "fully supports" the G1 garbage collector, but it seems those parameters are no longer available. :(

These links shed some more light on the allowed JVM flags:

Description of the G1 GC

JVM options

查看更多
登录 后发表回答