Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

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

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.

like image 572
Henning Avatar asked Oct 21 '25 06:10

Henning


1 Answers

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.

like image 150
Ivan Mamontov Avatar answered Oct 23 '25 19:10

Ivan Mamontov



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!