--- old/src/hotspot/share/gc/serial/defNewGeneration.cpp 2018-02-20 23:17:47.088835653 +0100 +++ new/src/hotspot/share/gc/serial/defNewGeneration.cpp 2018-02-20 23:17:46.864827996 +0100 @@ -178,6 +178,8 @@ DefNewGeneration::DefNewGeneration(ReservedSpace rs, size_t initial_size, + size_t min_size, + size_t max_size, const char* policy) : Generation(rs, initial_size), _preserved_marks_set(false /* in_c_heap */), @@ -201,17 +203,16 @@ // Compute the maximum eden and survivor space sizes. These sizes // are computed assuming the entire reserved space is committed. // These values are exported as performance counters. - uintx alignment = gch->collector_policy()->space_alignment(); + uintx alignment = gch->space_alignment(); uintx size = _virtual_space.reserved_size(); _max_survivor_size = compute_survivor_size(size, alignment); _max_eden_size = size - (2*_max_survivor_size); // allocate the performance counters - GenCollectorPolicy* gcp = gch->gen_policy(); // Generation counters -- generation 0, 3 subspaces _gen_counters = new GenerationCounters("new", 0, 3, - gcp->min_young_size(), gcp->max_young_size(), &_virtual_space); + min_size, max_size, &_virtual_space); _gc_counters = new CollectorCounters(policy, 0); _eden_counters = new CSpaceCounters("eden", 0, _max_eden_size, _eden_space, @@ -234,7 +235,7 @@ bool clear_space, bool mangle_space) { uintx alignment = - GenCollectedHeap::heap()->collector_policy()->space_alignment(); + GenCollectedHeap::heap()->space_alignment(); // If the spaces are being cleared (only done at heap initialization // currently), the survivor spaces need not be empty. @@ -488,7 +489,7 @@ } size_t DefNewGeneration::max_capacity() const { - const size_t alignment = GenCollectedHeap::heap()->collector_policy()->space_alignment(); + const size_t alignment = GenCollectedHeap::heap()->space_alignment(); const size_t reserved_bytes = reserved().byte_size(); return reserved_bytes - compute_survivor_size(reserved_bytes, alignment); } @@ -564,7 +565,7 @@ _tenuring_threshold = age_table()->compute_tenuring_threshold(desired_survivor_size); if (UsePerfData) { - GCPolicyCounters* gc_counters = GenCollectedHeap::heap()->gen_policy()->counters(); + GCPolicyCounters* gc_counters = GenCollectedHeap::heap()->counters(); gc_counters->tenuring_threshold()->set_value(_tenuring_threshold); gc_counters->desired_survivor_size()->set_value(desired_survivor_size * oopSize); } @@ -616,9 +617,6 @@ assert(gch->no_allocs_since_save_marks(), "save marks have not been newly set."); - // Not very pretty. - CollectorPolicy* cp = gch->collector_policy(); - FastScanClosure fsc_with_no_gc_barrier(this, false); FastScanClosure fsc_with_gc_barrier(this, true); @@ -688,7 +686,7 @@ // A successful scavenge should restart the GC time limit count which is // for full GC's. - AdaptiveSizePolicy* size_policy = gch->gen_policy()->size_policy(); + AdaptiveSizePolicy* size_policy = gch->size_policy(); size_policy->reset_gc_overhead_limit_count(); assert(!gch->incremental_collection_failed(), "Should be clear"); } else { @@ -953,7 +951,7 @@ // update the generation and space performance counters update_counters(); - gch->gen_policy()->counters()->update_counters(); + gch->counters()->update_counters(); } void DefNewGeneration::record_spaces_top() {