Fix the issue that in RegisterNativeAllocation the new_native_bytes_allocated
was not updated after Runfinalization, which may cause unnecessary GC.
Change-Id: Icbbc0d1cbcd7b1b8e42576104de69c8ff3afa745
Signed-off-by: Lin Zang <lin.zang@intel.com>
// Just finished a GC, attempt to run finalizers.
RunFinalization(env);
CHECK(!env->ExceptionCheck());
+ // Native bytes allocated may be updated by finalization, refresh it.
+ new_native_bytes_allocated = native_bytes_allocated_.LoadRelaxed();
}
// If we still are over the watermark, attempt a GC for alloc and run finalizers.
if (new_native_bytes_allocated > growth_limit_) {