From a7db4fecebe98135d36c6f46e1fa60959adbe78b Mon Sep 17 00:00:00 2001 From: William Kemper Date: Wed, 10 Jan 2024 17:10:39 +0000 Subject: [PATCH] 8323428: Shenandoah: Unused memory in regions compacted during a full GC should be mangled Reviewed-by: ysr, kdnilsen, shade --- src/hotspot/share/gc/shenandoah/shenandoahFullGC.cpp | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/hotspot/share/gc/shenandoah/shenandoahFullGC.cpp b/src/hotspot/share/gc/shenandoah/shenandoahFullGC.cpp index 18fd09ead0a..4cef5378d30 100644 --- a/src/hotspot/share/gc/shenandoah/shenandoahFullGC.cpp +++ b/src/hotspot/share/gc/shenandoah/shenandoahFullGC.cpp @@ -910,6 +910,9 @@ public: // Make empty regions that have been allocated into regular if (r->is_empty() && live > 0) { r->make_regular_bypass(); + if (ZapUnusedHeapArea) { + SpaceMangler::mangle_region(MemRegion(r->top(), r->end())); + } } // Reclaim regular regions that became empty