summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--runtime/gc/heap.cc6
-rw-r--r--runtime/gc/heap.h3
2 files changed, 2 insertions, 7 deletions
diff --git a/runtime/gc/heap.cc b/runtime/gc/heap.cc
index da08d3631f..d9d1e31246 100644
--- a/runtime/gc/heap.cc
+++ b/runtime/gc/heap.cc
@@ -138,7 +138,6 @@ Heap::Heap(size_t initial_size, size_t growth_limit, size_t min_free, size_t max
growth_limit_(growth_limit),
max_allowed_footprint_(initial_size),
native_footprint_gc_watermark_(initial_size),
- native_footprint_limit_(2 * initial_size),
native_need_to_run_finalization_(false),
// Initially assume we perceive jank in case the process state is never updated.
process_state_(kProcessStateJankPerceptible),
@@ -2829,7 +2828,6 @@ void Heap::UpdateMaxNativeFootprint() {
target_size = native_size + min_free_;
}
native_footprint_gc_watermark_ = target_size;
- native_footprint_limit_ = 2 * target_size - native_size;
}
collector::GarbageCollector* Heap::FindCollectorByGcType(collector::GcType gc_type) {
@@ -3101,14 +3099,14 @@ void Heap::RegisterNativeAllocation(JNIEnv* env, int bytes) {
// The second watermark is higher than the gc watermark. If you hit this it means you are
// allocating native objects faster than the GC can keep up with.
- if (new_native_bytes_allocated > native_footprint_limit_) {
+ if (new_native_bytes_allocated > growth_limit_) {
if (WaitForGcToComplete(kGcCauseForNativeAlloc, self) != collector::kGcTypeNone) {
// Just finished a GC, attempt to run finalizers.
RunFinalization(env);
CHECK(!env->ExceptionCheck());
}
// If we still are over the watermark, attempt a GC for alloc and run finalizers.
- if (new_native_bytes_allocated > native_footprint_limit_) {
+ if (new_native_bytes_allocated > growth_limit_) {
CollectGarbageInternal(gc_type, kGcCauseForNativeAlloc, false);
RunFinalization(env);
native_need_to_run_finalization_ = false;
diff --git a/runtime/gc/heap.h b/runtime/gc/heap.h
index 8f55c46949..a230f44635 100644
--- a/runtime/gc/heap.h
+++ b/runtime/gc/heap.h
@@ -894,9 +894,6 @@ class Heap {
// The watermark at which a concurrent GC is requested by registerNativeAllocation.
size_t native_footprint_gc_watermark_;
- // The watermark at which a GC is performed inside of registerNativeAllocation.
- size_t native_footprint_limit_;
-
// Whether or not we need to run finalizers in the next native allocation.
bool native_need_to_run_finalization_;