Request for review (S): 7166894 Add gc cause to Full GC logging for all collectors

Mikael Gerdin mikael.gerdin at
Mon May 7 13:33:06 UTC 2012

Hi Bengt,

Since you used fixed-size on stack buffers for the gc causes, would you 
mind using snprintf instead of sprintf just to be sure that you don't 
write outside the buffer? I know that no gc cause string is that long 
currently but better safe than sorry, right? :)


On 2012-05-07 14:31, Bengt Rutisson wrote:
> Hi all,
> Can I get a couple of reviews of this simple change:
> Background:
> I recently pushed a similar fix for G1 as "7163848: G1: Log GC Cause for
> a GC". That fix adds the GC cause information to all G1 GCs. It was
> discussed if we should do this for all collectors and we came to the
> conclusion that it would be fairly safe to do it for all Full GCs. These
> log messages already contain the text "(System)" or "(System.gc())" when
> a System.gc() happens and PrintGCDetails are enabled. Now they will
> always contain the cause in parenthesis, even when only PrintGC is
> enabled. Hopefully most parsing will work with this.
> Thanks,
> Bengt

More information about the hotspot-gc-dev mailing list