Add a new kReservedCapacity to decide when to start GC code.
Change-Id: Ib9d0ad9bc86c66ac29975f7f907f79f842342500
diff --git a/runtime/jit/jit_code_cache.cc b/runtime/jit/jit_code_cache.cc
index 74ff741..307bb6d 100644
--- a/runtime/jit/jit_code_cache.cc
+++ b/runtime/jit/jit_code_cache.cc
@@ -552,7 +552,7 @@
// we hold the lock.
{
MutexLock mu(self, lock_);
- if (!garbage_collect_code_) {
+ if (!garbage_collect_code_ || current_capacity_ < kReservedCapacity) {
IncreaseCodeCacheCapacity();
NotifyCollectionDone(self);
return;