Avoid collecting young gen while doing the full GC

Y. Srinivas Ramakrishna Y.S.Ramakrishna at Sun.COM
Tue Mar 23 19:27:12 UTC 2010


Hi Tony --

On 03/23/10 10:57, Tony Guan wrote:
> Hi all,
> 
> In my current project, one crazy idea is to leave the young generation
> untouched(not collected) during a Full Gc. Is it feasible if I want to
> collect the tenured gen only in a full GC?
> 
> To do this, the young gen should be included as part of the root set,
> and the reference processor should only care about the old gen. Is
> there anything else I should take care of?

Yes, i believe that should work. (In fact, the CMS collector, which collects
only the old gen and perm gen, does pretty much that. There are some disadvantages
to it though, for example, dead objects in the young gen possibly keeping
objects in old and perm gen artificially alive, but such cases are probably
rare.)

Just out of curiosity, when and wny would you want to not collect the young gen?

-- ramki

> 
> Thanks!
> 
> Tony




More information about the hotspot-gc-dev mailing list