Treat uffd-GC like CC when switching to jank-perceptible state
Bug: 160737021
Test: manual
(cherry picked from commit 947b322d2c38dea414e9578d25dcf6f1d3963102)
(cherry picked from https://googleplex-android-review.googlesource.com/q/commit:cf5897531ace5b55f2b7b82d375ce327d45b24aa)
Merged-In: I6d4a3f1285dcb1556cbf6a913b9ae43d840c84e2
Change-Id: I6d4a3f1285dcb1556cbf6a913b9ae43d840c84e2
diff --git a/runtime/gc/heap.cc b/runtime/gc/heap.cc
index 8942f44..6d50112 100644
--- a/runtime/gc/heap.cc
+++ b/runtime/gc/heap.cc
@@ -1543,15 +1543,16 @@
} else {
VLOG(gc) << "Homogeneous compaction ignored due to jank perceptible process state";
}
- } else if (desired_collector_type == kCollectorTypeCCBackground) {
+ } else if (desired_collector_type == kCollectorTypeCCBackground ||
+ desired_collector_type == kCollectorTypeCMC) {
DCHECK(gUseReadBarrier);
if (!CareAboutPauseTimes()) {
- // Invoke CC full compaction.
+ // Invoke full compaction.
CollectGarbageInternal(collector::kGcTypeFull,
kGcCauseCollectorTransition,
/*clear_soft_references=*/false, GC_NUM_ANY);
} else {
- VLOG(gc) << "CC background compaction ignored due to jank perceptible process state";
+ VLOG(gc) << "background compaction ignored due to jank perceptible process state";
}
} else {
CHECK_EQ(desired_collector_type, collector_type_) << "Unsupported collector transition";