How Does Your Garden Grow?

Actually, the title should be "How Does Your Generation Grow" but then the literary reference would have been totally lost.

I've written about how the generations grow if you are using GC ergonomics.

http://blogs.sun.com/jonthecollector/entry/it_s_not_magic

What if you're not using GC ergonomics? There is a different policy for growing and shrinking the heap that is used by the low pause collector and the serial collector. If you're interested in that policy, this is you're lucky blog.

It's actually pretty straightforward. At the end of the collection of a generation, we check the amount of free space in the generation. If the amount of free space is below a certain percentage (specified by MinHeapFreeRatio) of the total size of the generation, then the generation is expanded. Basically, we ask if we have enough free space in the generation so that the VM can run a while before we have to collect again. At the other end we don't want to have an excessive amount of free space so if the amount of free space is above a certain percentage (specified by MaxHeapFreeRatio) the generation is shrunk. That's it.

If you decide to play with the free ratio parameters, leave enough distance between MinHeapFreeRatio and MaxHeapFreeRatio so that the generations are not constantly adjusting by small amounts to get to the "perfect" ratio. Also our experience is that even if a generation does not need the extra free space right now, it will shortly, so don't be too aggressive with MaxHeapFreeRatio.

Will this policy eventually be replaced by GC ergonomics? Actually, I think not. I recently talked to a customer who told me that he was more concerned with bounds on the heap footprint than with achieving some specific throughput. The way he put it was something like "I don't want to be doing GC's all the time so there should be a good amount of free space in the heap but not too much". This policy is one approximation of what he wants.

Comments:

Hi, Do the survivor spaces in Eden ever get dynamically resized too?

Posted by Parwinder Sekhon on February 12, 2007 at 05:34 PM PST #

That would be good if the system could detect excessively high (or low) young-gen turnover for example... I never want to have to guess that myself as app installer!

Rgds

Damon

Posted by Damon Hart-Davis on February 12, 2007 at 06:53 PM PST #

Parwinder,

Yes, the survivor spaces are dynamically resized. If not using GC ergonomics, the SurvivorRatio is used to calculate the new size of the survivor spaces based on the new size of the young generation.

Damon,

I'm no sure what you mean by "turnover" in the young generation. If you're referring to the amount of promotion out of the young generation, without GC ergonomics the promotion rate is controlled by the tenuring threshold and that does not dynamically adjust. With GC ergonomics, it does dynamically adjust.

Posted by Jon Usmastami on February 23, 2007 at 09:42 AM PST #

Post a Comment:
Comments are closed for this entry.
About

jonthecollector

Search

Categories
Archives
« April 2014
SunMonTueWedThuFriSat
  
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
   
       
Today