Java: Why is the default for XX:SurvivorRatio not used?

12,703

There is the BOOK about java performance tuning:

-XX:SurvivorRatio=<n> should be used when you want to explicitly size survivor
spaces to manipulate object aging with the concurrent garbage collector, or to
manipulate object aging with the throughput garbage collector when adaptive sizing
is disabled using the command line option -XX:-UseAdaptiveSizePolicy.

So the -XX:SurvivorRatio is ignored unless you use -XX:-UseAdaptiveSizePolicy.

Share:
12,703
Henning
Author by

Henning

Updated on June 05, 2022

Comments

  • Henning
    Henning almost 2 years

    If you look at the documentation (e.g. http://www.oracle.com/technetwork/java/javase/tech/vmoptions-jsp-140102.html ) you will find a default 8 for XX:SurvivorRatio.

    If you check a running jvm which has been startet without explicitly setting a SurvivorRation you can see this default:

    jmap -heap <pid>
    

    will output

    ...
    SurvivorRatio    = 8
    ...
    

    But if you check the maximum size for S1 S0 using VisualGC, you can see that a SurvivorRatio = 1 is used instead.

    The picture changes if you start the java programm explicitly whith -XX:SurvivorRatio=8

    So why the default. A Default which is not used is quite irritating.