RFR: 8226797: serviceability/tmtools/jstat/GcCapacityTest.java fails with Exception: java.lang.RuntimeException: OGCMN > OGCMX (min generation capacity > max generation capacity)

Thomas Schatzl thomas.schatzl at oracle.com
Thu Dec 12 12:05:48 UTC 2019


Hi,

On 12.12.19 13:01, Stefan Karlsson wrote:
> Hi all,
> 
> Please review this patch to fix a problem with unintialized values in 
> our generation counters.
> 
> https://cr.openjdk.java.net/~stefank/8226797/webrev.01/
> https://bugs.openjdk.java.net/browse/JDK-8226797
> 
> The jstat values NGCMN and OGCMN both return uninitialized values.
> 
> I stumbled upon this while creating a patch to remove the GenerationSpec 
> class.
> 
> GenerationSpec::_min_size is never initialized, and then used to create 
> the generations:
> 
>      case Generation::DefNew:
>        return new DefNewGeneration(rs, _init_size, _min_size, _max_size);
> 
>      case Generation::MarkSweepCompact:
>        return new TenuredGeneration(rs, _init_size, _min_size, 
> _max_size, remset);
> 
> That in turn uses it to initialize the perf counters:
> DefNewGeneration::DefNewGeneration(ReservedSpace rs,
>                                     size_t initial_size,
>                                     size_t min_size,
>                                     size_t max_size,
>                                     const char* policy)
> ...
>    _gen_counters = new GenerationCounters("new", 0, 3,
>        min_size, max_size, &_virtual_space);
> 
> I'm setting the value to _init_size, because it reflects how MinNewSize 
> and MinOldSize relates to NewSize and OldSize.

Great find!

Looks good.

  Thomas



More information about the hotspot-gc-dev mailing list