Add a new kReservedCapacity to decide when to start GC code.
Change-Id: Ib9d0ad9bc86c66ac29975f7f907f79f842342500
diff --git a/runtime/jit/jit_code_cache.h b/runtime/jit/jit_code_cache.h
index 71f5cda..3fb5c70 100644
--- a/runtime/jit/jit_code_cache.h
+++ b/runtime/jit/jit_code_cache.h
@@ -49,7 +49,10 @@
static constexpr size_t kMaxCapacity = 64 * MB;
// Put the default to a very low amount for debug builds to stress the code cache
// collection.
- static constexpr size_t kInitialCapacity = kIsDebugBuild ? 16 * KB : 64 * KB;
+ static constexpr size_t kInitialCapacity = kIsDebugBuild ? 4 * KB : 64 * KB;
+
+ // By default, do not GC until reaching 256KB.
+ static constexpr size_t kReservedCapacity = kInitialCapacity * 4;
// Create the code cache with a code + data capacity equal to "capacity", error message is passed
// in the out arg error_msg.