Free ratio based heap shrinking in the parallel collector

Jon Masamitsu Jon.Masamitsu at Sun.COM
Thu Mar 11 07:10:39 UTC 2010

On Mar 10, 2010, at 4:04 PM, Jon Masamitsu wrote:

> Hiroshi,
> Have you signed a contributor agreement?  The gentleman
> who used to take care of those isn't in the group any longer
> and I'll have to go hunt it down before I look at the
> code.

I got confirmation that you're eligible to contribute.

> I'm going to be out of the office doing a
> presentation tomorrow so won't be able to pursue
> this until Friday at the earliest.
> But just in general when UseAdativeSizePolicy is
> off the UseParallelGC collector doesn't do any resizing.
> Can you just make this the sizing policy when
> UseAdativeSizePolicy is off (instead of adding the
> new flags)?

Sorry, I misread your mail.  I can see the reason for the
new flags.   I'll take a look at the  patch in the next
couple of days.

> Jon
> On 03/10/10 15:17, Hiroshi Yamauchi wrote:
>> Hi,
>> I'd like to have this patch
>> contributed, if appropriate.
>> It implements a simple heap shrinking logic based on the free ratio  
>> (MaxHeapFreeRatio) in the parallel collector. The way it works is  
>> the following: If the free ratio, (1.0 - <used> / <capacity>) * 100  
>> > MaxHeapFreeRatio, this logic kicks in. Otherwise, the (default)  
>> adaptive size policy runs the show (as before). This feature is  
>> turned off by default. There are two new flags to turn it on:
>>  UseFreeRatioForParallelGC - this enables it.
>>  UseFreeRatioOnlyInSystemGCForParallelGC - this enables it only in  
>> explicit System.gc() calls. This is more useful in apps that call  
>> System.gc() when it's idle and don't want shrinking to happen at  
>> all other times.
>> In our tests, it appears to work well in a simple test and to help  
>> a real app reduce its footprint (RSS) when it's idle.
>> Thanks to Chuck Rasbold who uploaded the webrev on my behalf.
>> Thanks,
>> Hiroshi

More information about the hotspot-gc-dev mailing list