hi, guys
When i load 3 webview with sample javascript at the same time,
code like this:
<script>
for(var i=0;i<100000;i++) {
console.log("Hello, World!");
}
</script>
for (int i = 0; i < 3; i++) {
WebView webView = new WebView(this);
WebSettings webSettings = webView.getSettings();
webSettings.setJavaScriptEnabled(true);
webSettings.setDisplayZoomControls(false);
webSettings.setLoadsImagesAutomatically(true);
webSettings.setBuiltInZoomControls(true);
webSettings.setDomStorageEnabled(true);
webSettings.setSupportMultipleWindows(true);
webView.loadUrl("file:///android_asset/js.html");
}
Mobile:galaxy s6 edge
model:SM-G925F
system: 7.0
Android System WebView: versionCode: 288309150 versiontName: 55.0.2883.91
When i run this sample,i found it cost about 1G memory rapidly
Mobile:Nexus 6
model:MOB31E
system: 6.0.1
Android System WebView: versionCode: 332514450 versiontName: 65.0.3325.144
When i run this sample,i found it cost about 1G memory rapidly
but change Android System WebView to : versionCode: 246011700 versiontName: 44.0.2403.117
it only cost about 10M
So,i test the Android System WebView from 44 to 65,i draw below conclusion.
1. Between webview version 44 and 52,on nexus 6 system 6.0.1,memory cost is normal.
2. Between webview version 53 and 57 on nexus 6 system 6.0.1,memory cost is high,but grow slowly.
3. Between webview version 55 and 57 on galaxy edge system 7.0,memory cost is high and grow very quickly.
4. On webview version 58 on nexus 6 system 6.0.1,memory cost is normal.
5. Between webview version 59 and 65 on nexus 6 system 6.0.1,memory cost is high and grow very very very fast
6. When i test on system 8.0,use webview version 62 and 65,mobile sony and huawei,memory cost is normal
I hope this code and test case can help to make chrome better, and fix the chrome memory bug when load bad js.
Thanks!
xuan long於 2018年3月7日星期三 UTC+8下午5時25分11秒寫道: