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),
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) {
// 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;
// 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_;