summaryrefslogtreecommitdiff
path: root/compiler/optimizing/codegen_test_utils.h
diff options
context:
space:
mode:
authorHans Boehm <hboehm@google.com>2021-03-08 09:21:16 -0800
committerHans Boehm <hboehm@google.com>2021-04-23 21:37:25 +0000
commit6d5a49c9b0f26a21316577683f282cf3bef492e3 (patch)
treeec8da125e2cc663c1ecc94e5ebda33a212f6f72b /compiler/optimizing/codegen_test_utils.h
parent0cdbf97c3d654b8e985361e44952ef03d3fa4714 (diff)
Solidify GC triggering and reporting
Ensure that multiple roughly simultaneous collection requests are unlikely to result in multiple GCs. Previously multiple direct calls to CollectGarbageInternal would essentially be queued, with each waiting for the previous one to complete. This might happen if we're essentially out of memory, with multiple threads running. Whenever easily possible, capture the GC number before checking whether we should GC, so that we can corrrectly check for a GC triggered since we performed the test. Reset GC cause when appropriate so HeapTrim doesn't always show up as the cause. Update old_native_bytes_allocated before FinishGC(), closing the window during which we could decide to start a second native-triggered GC without having seen the effect of the first. No longer support ConcurrentGC() calls from VMRuntime, since they weren't safe anyway. No longer mark the GC following a WaitForGCToComplete triggered by native allocation as blocking. That wait just waits for the previous GC and does not trigger a new one. We already marked the previous one as blocking. Have CheckGCForNative sleep briefly if the GC it's waiting for hasn't started yet. Previously it waited for a running GC to finish, but the requested one may not yet have started by then. Drive-by fix for TotalBytesAllocated() metric. Test: Build and boot AOSP. Manually check GC log messages. Bug: 181351667 Change-Id: Ifd1e4afdffca7de25844d49299d552fce44b6760
Diffstat (limited to 'compiler/optimizing/codegen_test_utils.h')
0 files changed, 0 insertions, 0 deletions