diff --git a/gc/base/GCCode.cpp b/gc/base/GCCode.cpp index 6f954ecee5f..5d8a81ebd6e 100644 --- a/gc/base/GCCode.cpp +++ b/gc/base/GCCode.cpp @@ -42,9 +42,7 @@ MM_GCCode::isExplicitGC() const case J9MMCONSTANT_IMPLICIT_GC_PERCOLATE_CRITICAL_REGIONS: case J9MMCONSTANT_IMPLICIT_GC_PERCOLATE_UNLOADING_CLASSES: case J9MMCONSTANT_IMPLICIT_GC_COMPLETE_CONCURRENT: -#if defined(OMR_GC_CONCURRENT_SCAVENGER) case J9MMCONSTANT_IMPLICIT_GC_PERCOLATE_ABORTED_SCAVENGE: -#endif /* defined(OMR_GC_CONCURRENT_SCAVENGER) */ explicitGC = false; break; case J9MMCONSTANT_EXPLICIT_GC_NATIVE_OUT_OF_MEMORY: @@ -88,9 +86,7 @@ MM_GCCode::shouldAggressivelyCompact() const case J9MMCONSTANT_IMPLICIT_GC_PERCOLATE_CRITICAL_REGIONS: case J9MMCONSTANT_IMPLICIT_GC_PERCOLATE_UNLOADING_CLASSES: case J9MMCONSTANT_IMPLICIT_GC_COMPLETE_CONCURRENT: -#if defined(OMR_GC_CONCURRENT_SCAVENGER) case J9MMCONSTANT_IMPLICIT_GC_PERCOLATE_ABORTED_SCAVENGE: -#endif /* defined(OMR_GC_CONCURRENT_SCAVENGER) */ #if defined(OMR_GC_IDLE_HEAP_MANAGER) case J9MMCONSTANT_EXPLICIT_GC_IDLE_GC: #endif /* defined(OMR_GC_IDLE_HEAP_MANAGER) */ @@ -128,9 +124,7 @@ MM_GCCode::isOutOfMemoryGC() const case J9MMCONSTANT_IMPLICIT_GC_PERCOLATE_CRITICAL_REGIONS: case J9MMCONSTANT_IMPLICIT_GC_PERCOLATE_UNLOADING_CLASSES: case J9MMCONSTANT_IMPLICIT_GC_COMPLETE_CONCURRENT: -#if defined(OMR_GC_CONCURRENT_SCAVENGER) case J9MMCONSTANT_IMPLICIT_GC_PERCOLATE_ABORTED_SCAVENGE: -#endif /* defined(OMR_GC_CONCURRENT_SCAVENGER) */ #if defined(OMR_GC_IDLE_HEAP_MANAGER) case J9MMCONSTANT_EXPLICIT_GC_IDLE_GC: #endif /* defined(OMR_GC_IDLE_HEAP_MANAGER) */ @@ -172,9 +166,7 @@ MM_GCCode::isAggressiveGC() const case J9MMCONSTANT_IMPLICIT_GC_PERCOLATE_CRITICAL_REGIONS: case J9MMCONSTANT_IMPLICIT_GC_PERCOLATE_UNLOADING_CLASSES: case J9MMCONSTANT_IMPLICIT_GC_COMPLETE_CONCURRENT: -#if defined(OMR_GC_CONCURRENT_SCAVENGER) case J9MMCONSTANT_IMPLICIT_GC_PERCOLATE_ABORTED_SCAVENGE: -#endif /* defined(OMR_GC_CONCURRENT_SCAVENGER) */ aggressiveGC = false; break; default: @@ -212,9 +204,7 @@ MM_GCCode::isImplicitAggressiveGC() const case J9MMCONSTANT_IMPLICIT_GC_PERCOLATE_CRITICAL_REGIONS: case J9MMCONSTANT_IMPLICIT_GC_PERCOLATE_UNLOADING_CLASSES: case J9MMCONSTANT_IMPLICIT_GC_COMPLETE_CONCURRENT: -#if defined(OMR_GC_CONCURRENT_SCAVENGER) case J9MMCONSTANT_IMPLICIT_GC_PERCOLATE_ABORTED_SCAVENGE: -#endif /* defined(OMR_GC_CONCURRENT_SCAVENGER) */ implicitAggressiveGC = false; break; default: @@ -239,9 +229,7 @@ MM_GCCode::isPercolateGC() const case J9MMCONSTANT_IMPLICIT_GC_PERCOLATE_AGGRESSIVE: case J9MMCONSTANT_IMPLICIT_GC_PERCOLATE_CRITICAL_REGIONS: case J9MMCONSTANT_IMPLICIT_GC_PERCOLATE_UNLOADING_CLASSES: -#if defined(OMR_GC_CONCURRENT_SCAVENGER) case J9MMCONSTANT_IMPLICIT_GC_PERCOLATE_ABORTED_SCAVENGE: -#endif /* defined(OMR_GC_CONCURRENT_SCAVENGER) */ percolateGC = true; break; case J9MMCONSTANT_EXPLICIT_GC_NATIVE_OUT_OF_MEMORY: diff --git a/gc/base/standard/Scavenger.cpp b/gc/base/standard/Scavenger.cpp index fd117d41394..6246d4d9e20 100644 --- a/gc/base/standard/Scavenger.cpp +++ b/gc/base/standard/Scavenger.cpp @@ -4632,7 +4632,6 @@ MM_Scavenger::internalGarbageCollect(MM_EnvironmentBase *envBase, MM_MemorySubSp return true; } -#if defined(OMR_GC_CONCURRENT_SCAVENGER) if (IS_CONCURRENT_ENABLED && isBackOutFlagRaised()) { bool result = percolateGarbageCollect(env, subSpace, NULL, ABORTED_SCAVENGE, J9MMCONSTANT_IMPLICIT_GC_PERCOLATE_ABORTED_SCAVENGE); @@ -4640,7 +4639,6 @@ MM_Scavenger::internalGarbageCollect(MM_EnvironmentBase *envBase, MM_MemorySubSp return true; } -#endif /* First, if the previous scavenge had a failed tenure of a size greater than the threshold, * ask parent MSS to try a collect. @@ -4792,6 +4790,14 @@ MM_Scavenger::internalGarbageCollect(MM_EnvironmentBase *envBase, MM_MemorySubSp #endif { mainThreadGarbageCollect(env, allocDescription); + /* We want to recursively call percolate gc here in order that the excessive gc + * identifies the outermost gc and records the metrics correctly. + */ + if (isBackOutFlagRaised()) { + bool result = percolateGarbageCollect(env, subSpace, NULL, ABORTED_SCAVENGE, J9MMCONSTANT_IMPLICIT_GC_PERCOLATE_ABORTED_SCAVENGE); + Assert_MM_true(result); + return true; + } } /* If we know now that the next scavenge will cause a peroclate broadcast diff --git a/include_core/j9nongenerated.h b/include_core/j9nongenerated.h index 4445c14acd2..aae61856515 100644 --- a/include_core/j9nongenerated.h +++ b/include_core/j9nongenerated.h @@ -128,9 +128,7 @@ typedef struct J9VMGC_SublistFragment { #define J9MMCONSTANT_IMPLICIT_GC_EXCESSIVE 8 #define J9MMCONSTANT_IMPLICIT_GC_PERCOLATE_UNLOADING_CLASSES 9 #define J9MMCONSTANT_IMPLICIT_GC_PERCOLATE_CRITICAL_REGIONS 10 -#if defined(OMR_GC_CONCURRENT_SCAVENGER) #define J9MMCONSTANT_IMPLICIT_GC_PERCOLATE_ABORTED_SCAVENGE 11 -#endif #if defined(OMR_GC_IDLE_HEAP_MANAGER) #define J9MMCONSTANT_EXPLICIT_GC_IDLE_GC 12 #endif