title: Android WebView - JavaScript Memory Leak
body: <p>I am having an issue with Javascript in WebView (enabled using webview.getSettings().setJavascriptEnabled(true); )  The HTML pages with embedded Javascript loads and displays properly, however, what I am also doing is constantly refreshing the screen every 10 or 30 seconds.  When I go into the shell of my test device (MK808 mini-tv) I use "dumpsys meminfo" in order to see the memory of the processes.  Displaying the memory of my app's process every 5 seconds I can see that whenever the page refreshes, the app's memory usage jump multiple (4-10) megabytes.  This continues for around 30 minutes or so until the app crashes with a Fatal Signal 11 error in the WebViewCoreThread, with no stack trace.</p>
  
  <p>Constant Increasing Memory (started at around 15000kb):</p>
  
  <p><a href="https://i.stack.imgur.com/Kb0Jb.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/Kb0Jb.png" alt="enter image description here"></a></p>
  
  <hr>
  
  <p>None of these memory issues or errors occur when javascript is NOT enabled.</p>
  
  <p>I clearCache(true) and freeMemory(), as well as every other database and cache clear, every single time before I refresh.</p>
  
  <p>I have also tried destroying the WebView after each refresh and creating a brand new one, to no avail.</p>
  
  <p>I can easily remake this issue by just making a new Application project and making a webview that reloads based on a handler controlling time..This seems like it should be a widespread issue but I can't find anything on the subject.  Could it be my device?</p>
  
  <p>Thanks in advance for the help, I'll be glad to add more information as needed!</p>