NewRatio: to twiddle or not to twiddle
Tom Rodriguez
Thomas.Rodriguez at Sun.COM
Tue Sep 2 12:52:23 PDT 2008
Which collector are you using? -client defaults to the serial
collector which isn't adaptive at all. -server will use the parallel
collector which tries to resize the new generation to improve
collector performance. If you are running with -client try adding -XX:
+UseParallelGC. I often see much better performance with -client just
from this change.
tom
On Sep 2, 2008, at 11:50 AM, Charles Oliver Nutter wrote:
> 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.
>
> Thoughts?
>
> (And please let me know if there's a better list to post this sort
> of question to)
>
> - Charlie
More information about the hotspot-dev
mailing list