java7 G1 Options

大兔子大兔子 提交于 2020-01-13 18:06:41

问题


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

-XX:+G1ParallelRSetUpdatingEnabled 
-XX:+G1ParallelRSetScanningEnabled 

回答1:


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:

  • Java SE 6 Update 14 Release Notes
  • G1 Garbage First Collector Introduction
  • Java HotSpot VM Options
  • Plus a presentation on JVM Tuning



回答2:


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



来源:https://stackoverflow.com/questions/8262674/java7-g1-options

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!