Are ratios between spaces/generations in the Java Heap constant?

前端 未结 3 428
离开以前
离开以前 2020-12-24 10:29

I have read this article about virtual machine garbage collection tuning to understand the java garbage collector better. Each space has a Virtual heap space area

3条回答
  •  余生分开走
    2020-12-24 10:36

    I think you are referring to GC Ergonomics and the Adaptive Size Policy

    • a feature of the Hotspost GC that automatically adapts the sizes of the generations at runtime based on the current allocation behavior of the running application.
    • This feature is ON by default and controls/adapts the size of the generations at runtime.
    • in fact, some of the GC parameters will be ignored if you do not disable Adaptive Size policy, eg. -XX:SurvivorRatio=.

    You can disable the Adaptive Size Policy by using the -XX:-UseAdaptiveSizePolicy. Once you disabled the AdaptiveSizePolicy, the GC will respect the initial size of the generations as specified by your startup parameters (e.g. -Xms, -Xmx, -XX:MaxNewSize=,-XX:NewSize=, -XX:SurvivorRatio=) and they will remain constant.

    You can find more on Adaptive Size policy in UseAdaptiveSizePolicy and other jvm opts.

提交回复
热议问题