Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 07837862 authored by Shimeng (Simon) Wang's avatar Shimeng (Simon) Wang Committed by Android (Google) Code Review
Browse files

Merge "Fine tune the high memory threshold and usage delta for v8 GC." into honeycomb

parents 8a445fc3 7114f3bf
Loading
Loading
Loading
Loading
+2 −7
Original line number Diff line number Diff line
@@ -188,14 +188,9 @@ final class WebViewCore {
        // Allow us to use up to our memory class value before V8's GC kicks in.
        // These values have been determined by experimentation.
        mLowMemoryUsageThresholdMb = manager.getLargeMemoryClass();
        // If things get crazy, allow V8 to use up to 3 times our memory class, or a third of the
        // device's total available memory, whichever is smaller.  This value must be no less
        // than the low memory threshold.
        // At that point V8 will start attempting more aggressive garbage collection.
        mHighMemoryUsageThresholdMb = Math.max(Math.min(mLowMemoryUsageThresholdMb * 3,
                (int) (memInfo.availMem / 3) >> 20), mLowMemoryUsageThresholdMb);
        mHighMemoryUsageThresholdMb = (int) (mLowMemoryUsageThresholdMb * 1.5);
        // Avoid constant V8 GC when memory usage equals to working set estimate.
        mHighUsageDeltaMb = 1;
        mHighUsageDeltaMb = mLowMemoryUsageThresholdMb / 32;

        // Send a message to initialize the WebViewCore.
        Message init = sWebCoreHandler.obtainMessage(