diff options
author | 2023-07-20 14:04:21 +0100 | |
---|---|---|
committer | 2023-07-20 15:01:51 +0000 | |
commit | a74424c4805883c39f96af0ce6e603396e7dddf1 (patch) | |
tree | 0102aab755002369ea5982ae63bbda3c7106c967 | |
parent | e5a09b184db65ab5802824e0102f7a42f3d9b184 (diff) |
Update missed comment.
Change-Id: I45b1e96c18d7117669c6a59a8431c9ab441a8fee
-rw-r--r-- | runtime/gc/heap_test.cc | 5 |
1 files changed, 3 insertions, 2 deletions
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<mirror::String> 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); |