PromotionInfo initialization and reset() are not consistent,

Dang Nhan Nguyen nhann at
Tue Sep 13 13:52:30 UTC 2011

Hi all,

When I look at PromotionInfo class, I saw a small difference in resetting values (_firstIndex and _nextIndex) between the construction and reset(): 

PromotionInfo() :
    _tracking(0), _space(NULL),
    _promoHead(NULL), _promoTail(NULL),
    _spoolHead(NULL), _spoolTail(NULL),
    _spareSpool(NULL), _firstIndex(1),
    _nextIndex(1) {}

And reset():
void reset() {
    _promoHead = NULL;
    _promoTail = NULL;
    _spoolHead = NULL;
    _spoolTail = NULL;
    _spareSpool = NULL;
    _firstIndex = 0;
    _nextIndex = 0;


My question is that when promotionInfo.reset() is called, then many consistency checks like the below in PromotionInfo will failed:
PromotionInfo.cpp[Line 323] guarantee(_spoolTail != NULL || _nextIndex == 1,
            "Inconsistency between _spoolTail and _nextIndex");

What is the purpose of resetting the _firstIndex and _nextIndex to 0? Or is it a mistake?

--Nhan Nguyen

> -----Original Message-----
> From: hotspot-gc-dev-bounces at [mailto:hotspot-gc-dev-
> bounces at] On Behalf Of Peter Schuller
> Sent: Friday, July 30, 2010 11:59 PM
> To: Todd Lipcon
> Cc: hotspot-gc-use at
> Subject: Re: G1GC Full GCs
> > Yep, I've seen JRRT also "abort compaction" on most compactions. I
> couldn't
> > quite figure out how to tell it that it was fine to pause more often
> for
> > compaction, so long as each pause was short.
> FWIW, I got the impression at the time (but I don't remember why; I
> think I was half-guessing based on assumptions about what it does and
> several iterations through the documentation) that it was
> fundamentally only *able* to do compaction during the stop-the-world
> pause after a concurrent mark phase. I.e., I don't think you can make
> it spread the work out (but I can most definitely be wrong).
> --
> / Peter Schuller
> _______________________________________________
> hotspot-gc-use mailing list
> hotspot-gc-use at

More information about the hotspot-gc-dev mailing list