Only protect cleared regions for target builds
Prevent flaky crashes from bad kernels.
Test: test-art-host
Bug: 63131961
Change-Id: I864b6d5210d9c1ae976465ae821d54da817f4970
diff --git a/runtime/gc/space/region_space.cc b/runtime/gc/space/region_space.cc
index 26b7282..1f7bd09 100644
--- a/runtime/gc/space/region_space.cc
+++ b/runtime/gc/space/region_space.cc
@@ -30,7 +30,8 @@
static constexpr uint kEvaculateLivePercentThreshold = 75U;
// If we protect the cleared regions.
-static constexpr bool kProtectClearedRegions = true;
+// Only protect for target builds to prevent flaky test failures (b/63131961).
+static constexpr bool kProtectClearedRegions = kIsTargetBuild;
MemMap* RegionSpace::CreateMemMap(const std::string& name, size_t capacity,
uint8_t* requested_begin) {