--- old/src/hotspot/share/gc/shared/genCollectedHeap.cpp 2018-02-21 20:27:20.084544106 +0100 +++ new/src/hotspot/share/gc/shared/genCollectedHeap.cpp 2018-02-21 20:27:19.872536875 +0100 @@ -65,6 +65,7 @@ CollectedHeap(), _rem_set(NULL), _gen_policy(policy), + _soft_ref_gen_policy(), _process_strong_tasks(new SubTasksDone(GCH_PS_NumElements)), _full_collections_completed(0) { @@ -150,6 +151,7 @@ _gen_policy->initialize_size_policy(def_new_gen->eden()->capacity(), _old_gen->capacity(), def_new_gen->from()->capacity()); + _gen_policy->initialize_gc_policy_counters(); } @@ -331,7 +333,7 @@ // so that the overhead exceeded does not persist. const bool limit_exceeded = gen_policy()->size_policy()->gc_overhead_limit_exceeded(); - const bool softrefs_clear = gen_policy()->all_soft_refs_clear(); + const bool softrefs_clear = soft_ref_policy()->all_soft_refs_clear(); if (limit_exceeded && softrefs_clear) { *gc_overhead_limit_was_exceeded = true; @@ -522,9 +524,9 @@ GCIdMark gc_id_mark; const bool do_clear_all_soft_refs = clear_all_soft_refs || - collector_policy()->should_clear_all_soft_refs(); + soft_ref_policy()->should_clear_all_soft_refs(); - ClearedAllSoftRefs casr(do_clear_all_soft_refs, collector_policy()); + ClearedAllSoftRefs casr(do_clear_all_soft_refs, soft_ref_policy()); const size_t metadata_prev_used = MetaspaceAux::used_bytes(); @@ -720,7 +722,7 @@ return result; } - assert(!gen_policy()->should_clear_all_soft_refs(), + assert(!soft_ref_policy()->should_clear_all_soft_refs(), "Flag should have been handled and cleared prior to this point"); // What else? We might try synchronous finalization later. If the total