From 4d72998fdadf17429f6868dae76c4d2e7b6be7b1 Mon Sep 17 00:00:00 2001 From: "Torne (Richard Coles)" Date: Mon, 6 May 2019 16:24:54 -0400 Subject: [PATCH] Increase 32-bit WebView VA reservation. Most pre-Q devices actually reserved around 130MiB in the 32-bit zygote for the WebView native library; 100MiB was only the lower limit and the file size based calculation that older OS versions use would come up with a larger number. Increase the hardcoded value for Q to 130MiB so that the behaviour is roughly the same across OS versions. Fixes: 132081320 Test: manually verified via inspection of process maps Change-Id: I0f03ac2f118bb0627ea6be229e5064d4590d8afb --- core/java/android/webkit/WebViewLibraryLoader.java | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/core/java/android/webkit/WebViewLibraryLoader.java b/core/java/android/webkit/WebViewLibraryLoader.java index 5a6aebaaad512..be49fc434c791 100644 --- a/core/java/android/webkit/WebViewLibraryLoader.java +++ b/core/java/android/webkit/WebViewLibraryLoader.java @@ -181,9 +181,9 @@ public class WebViewLibraryLoader { boolean is64Bit = VMRuntime.getRuntime().is64Bit(); // On 64-bit address space is really cheap and we can reserve 1GB which is plenty. // On 32-bit it's fairly scarce and we should keep it to a realistic number that - // permits some future growth but doesn't hog space: we use 100MB which is more than 2x - // the current requirement. - long addressSpaceToReserve = is64Bit ? 1 * 1024 * 1024 * 1024 : 100 * 1024 * 1024; + // permits some future growth but doesn't hog space: we use 130MB which is roughly + // what was calculated on older OS versions in practice. + long addressSpaceToReserve = is64Bit ? 1 * 1024 * 1024 * 1024 : 130 * 1024 * 1024; sAddressSpaceReserved = nativeReserveAddressSpace(addressSpaceToReserve); if (sAddressSpaceReserved) {