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

Commit c1df157a authored by Shimeng (Simon) Wang's avatar Shimeng (Simon) Wang Committed by Android Git Automerger
Browse files

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

* commit '07837862':
  Fine tune the high memory threshold and usage delta for v8 GC.
parents 4b1c8389 07837862
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(