RFR (L): JDK-6843347 Boundary values in some public GC options cause crashes

Thomas Schatzl thomas.schatzl at oracle.com
Tue May 14 07:48:19 UTC 2013


Hi,

On Tue, 2013-05-14 at 08:47 +0200, Bengt Rutisson wrote:
> 
> Hi Thomas,
> 
> In arguments.cpp you check for MarkSweepAlwaysCompactCount == 0 and in
> that case silently set MarkSweepAlwaysCompactCount = 1. I think I
> would prefer not to reset it and let there be an error message when we
> hit "verify_min_value(MarkSweepAlwaysCompactCount, 1,
> "MarkSweepAlwaysCompactCount");" further down. Otherwise people won't
> know that they have made a mistake on the command line if they run
> with -XX:MarkSweepAlwaysCompactCount=0.

That's fine with me - I added that for backwards compatibility as the
use e.g. in psMarkSweepDecorator.cpp also silently set it to this value.

> One minor nit:
> 
> In psMarkSweep.cpp you updated one line to be:
> 
> unsigned int count = (maximum_heap_compaction)? 1 :
> MarkSweepAlwaysCompactCount;
> 
> I don't think the parenthesis increase readability here, but it would
> help with a space before the ?. Also, I am more used to seeing uint
> instead of unsigned int, but HotSpot has a lot of occurrences of both
> variants, so I leave it up to you to choose. So, to summarize I would
> prefer:
> 
> uint count = maximum_heap_compaction ? 1 :
> MarkSweepAlwaysCompactCount;
> 
Will fix both issues. I changed the type to uint as I also prefer that.
Thanks for your comments.

Thomas






More information about the hotspot-gc-dev mailing list