question

qiaosi avatar image
qiaosi asked

WebView Memory Leak Issue On Kindle Fire HD/HDX

Hi, We are displaying a webView inside our game on kindle fire. Every time it loads url by just simply calling Android webView.loadUrl(), it causes memory leak. After loading url for a couple times, the app crashes for OOM.
fire tablet
10 |5000

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.

1 Answer

Sujoy@Amazon avatar image
Sujoy@Amazon answered
We are unable to reproduce the issue by using below code. public class TestWebActivity extends Activity { private WebView mWebView; @Override protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.testwebactivity); mWebView = (WebView) findViewById(R.id.webView1); mWebView.getSettings().setJavaScriptEnabled(true); mWebView.setWebViewClient(new WebViewClient() { @Override public boolean shouldOverrideUrlLoading(WebView view, String url) { return super.shouldOverrideUrlLoading(view, url); } }); mWebView.loadUrl(" https://www.google.com"); } public void load(View view){ mWebView.loadUrl(" https://www.google.com"); } } Please provide the code snippet you are using to load the page on web view. You might consider also Amazon Web View which is a drop-in replacement for the standard Android WebView class and is backed by a modern web-rendering engine. https://developer.amazon.com/public/solutions/platforms/android-fireos/docs/building-and-testing-your-hybrid-app
10 |5000

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.