From a74424c4805883c39f96af0ce6e603396e7dddf1 Mon Sep 17 00:00:00 2001 From: Nicolas Geoffray Date: Thu, 20 Jul 2023 14:04:21 +0100 Subject: Update missed comment. Change-Id: I45b1e96c18d7117669c6a59a8431c9ab441a8fee --- runtime/gc/heap_test.cc | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) (limited to 'runtime/gc/heap_test.cc') diff --git a/runtime/gc/heap_test.cc b/runtime/gc/heap_test.cc index 57358e6ef1..42ba911062 100644 --- a/runtime/gc/heap_test.cc +++ b/runtime/gc/heap_test.cc @@ -120,8 +120,9 @@ TEST_F(HeapTest, GCMetrics) { Handle string [[maybe_unused]] ( hs.NewHandle(mirror::String::AllocFromModifiedUtf8(soa.Self(), "test"))); } - // Do one GC while the temporary objects cannot be collected. This GC will age the objects,and - // ensure that the GC at line 127 does scan the objects. + // Do one GC while the temporary objects are reachable, forcing the GC to scan something. + // The subsequent GC at line 127 may not scan anything but will certainly free some bytes. + // Together the two GCs ensure success of the test. heap->CollectGarbage(/* clear_soft_references= */ false); } heap->CollectGarbage(/* clear_soft_references= */ false); -- cgit v1.2.3-59-g8ed1b