From fe0c1985ce3276f3c8989de8d95e6a8316d84aff Mon Sep 17 00:00:00 2001 From: Xiaolong Peng Date: Thu, 11 Jun 2026 14:31:07 -0700 Subject: [PATCH] fix: wrong comments on update watermark --- .../share/gc/shenandoah/shenandoahPartitionAllocator.cpp | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/hotspot/share/gc/shenandoah/shenandoahPartitionAllocator.cpp b/src/hotspot/share/gc/shenandoah/shenandoahPartitionAllocator.cpp index 07213908fed..af22deece56 100644 --- a/src/hotspot/share/gc/shenandoah/shenandoahPartitionAllocator.cpp +++ b/src/hotspot/share/gc/shenandoah/shenandoahPartitionAllocator.cpp @@ -144,7 +144,9 @@ HeapWord* ShenandoahPartitionAllocator::allocate_in(ShenandoahHeapReg _free_set->increase_partition_used(PARTITION, req.actual_size() * HeapWordSize); } else { assert(req.is_gc_alloc(), "Should be gc_alloc since req wasn't mutator alloc"); - // GC allocations set update_watermark so relocated objects aren't re-updated during update-refs. + // For GC allocations, we advance update_watermark because the objects relocated into this memory during + // evacuation are not updated during evacuation. For both young and old regions, it is essential that all + // PLABs be made parsable at the end of evacuation. This is enabled by retiring all plabs at end of evacuation. r->set_update_watermark(r->top()); _free_set->increase_partition_used(PARTITION, (req.actual_size() + req.waste()) * HeapWordSize); }