diff options
| author | Shimeng (Simon) Wang <swang@google.com> | 2011-01-26 13:23:58 -0800 |
|---|---|---|
| committer | Android (Google) Code Review <android-gerrit@google.com> | 2011-01-26 13:23:58 -0800 |
| commit | 078378624c1955a1e842af34f79798918edccc21 (patch) | |
| tree | 4f2fda66fa20f9e8ac1c1e8a797ae94a55eafe0d /core/java | |
| parent | 8a445fc30e45c1f7a9805ae19948ec32786458a0 (diff) | |
| parent | 7114f3bf6d5b2dab91a38400b430ab7012a9ce1b (diff) | |
Merge "Fine tune the high memory threshold and usage delta for v8 GC." into honeycomb
Diffstat (limited to 'core/java')
| -rw-r--r-- | core/java/android/webkit/WebViewCore.java | 9 |
1 files changed, 2 insertions, 7 deletions
diff --git a/core/java/android/webkit/WebViewCore.java b/core/java/android/webkit/WebViewCore.java index 0992079b464e..069e8ef225b4 100644 --- a/core/java/android/webkit/WebViewCore.java +++ b/core/java/android/webkit/WebViewCore.java @@ -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( |
