NewRatio: to twiddle or not to twiddle
Charles Oliver Nutter
charles.nutter at sun.com
Tue Sep 2 11:50:07 PDT 2008
I've ben playing with JRuby on various benchmarks recently and found
that several object-intensive scripts run better if I set NewRatio=1.
Ruby, even more than Java, tends to generate lots and lots of objects,
especially considering that there's no unboxed primitive numeric types
(and no fixnums on the JVM...ahem ahem). So my general theory is that:
1. A NewRatio of 1 allows all those extra transient objects to get
collected more quickly.
2. Too small a "new" generation causes transient objects to get shoved
into older generations, potentially snowballing and forcing more
comprehensive GC runs as time goes on.
I'm curious whether this theory sounds reasonable, whether there's a
better way I can adapt hotspot to the memory demands of a dynamic
language like Ruby, and what other implications there are in setting
NewRatio to 1.
(And please let me know if there's a better list to post this sort of
More information about the hotspot-dev