--- old/src/hotspot/share/gc/g1/g1CollectedHeap.hpp 2018-10-19 10:53:53.000000000 -0400 +++ new/src/hotspot/share/gc/g1/g1CollectedHeap.hpp 2018-10-19 10:53:53.000000000 -0400 @@ -352,7 +352,7 @@ assert(Thread::current()->is_VM_thread(), "current thread is not VM thread"); \ } while (0) - // The young region list. + // The young region lists. G1EdenRegions _eden; G1SurvivorRegions _survivor; @@ -1041,7 +1041,7 @@ inline void archive_set_add(HeapRegion* hr); size_t non_young_capacity_bytes() { - return (old_regions_count() + _archive_set.length() + humongous_regions_count()) * HeapRegion::GrainBytes; + return (old_regions_count() + archive_regions_count() + humongous_regions_count()) * HeapRegion::GrainBytes; } // Determine whether the given region is one that we are using as an @@ -1216,19 +1216,18 @@ virtual jlong millis_since_last_gc(); - // Convenience function to be used in situations where the heap type can be // asserted to be this type. static G1CollectedHeap* heap(); void set_region_short_lived_locked(HeapRegion* hr); - // add appropriate methods for any other surv rate groups + // add appropriate methods for any other survivor rate groups const G1SurvivorRegions* survivor() const { return &_survivor; } uint eden_regions_count() const { return _eden.length(); } uint survivor_regions_count() const { return _survivor.length(); } - uint young_regions_count() const { return _eden.length() + _survivor.length(); } + uint young_regions_count() const { return eden_regions_count() + survivor_regions_count(); } uint old_regions_count() const { return _old_set.length(); } uint archive_regions_count() const { return _archive_set.length(); } uint humongous_regions_count() const { return _humongous_set.length(); }