Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 6088725
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 23, 20262026-05-23T12:01:06+00:00 2026-05-23T12:01:06+00:00

I’m loading long pages into a WebView using loadData(), unfortunately after around 5 or

  • 0

I’m loading long pages into a WebView using loadData(), unfortunately after around 5 or 10 page links it gives an OutOfMemoryException. This is likely caused by the history holding the full data: url of every page.

I have a memory & cpu monitor in the status bar, and it always shows hardly any memory usage, so the app isn’t using up all memory. Is there a way to allow my app to use more memory, similar to Java’s command-line switches? Is there a way to make the webview more efficient, perhaps by making a cache on the sd card, to prevent this crash?

06-27 12:02:44.746: WARN/System.err(6692): java.lang.OutOfMemoryError
06-27 12:02:44.746: WARN/System.err(6692):     at java.lang.AbstractStringBuilder.enlargeBuffer(AbstractStringBuilder.java:97)
06-27 12:02:44.746: WARN/System.err(6692):     at java.lang.AbstractStringBuilder.append0(AbstractStringBuilder.java:157)
06-27 12:02:44.746: WARN/System.err(6692):     at java.lang.StringBuilder.append(StringBuilder.java:217)
06-27 12:02:44.746: WARN/System.err(6692):     at android.webkit.BrowserFrame.startLoadingResource(BrowserFrame.java:710)
06-27 12:02:44.746: WARN/System.err(6692):     at android.webkit.BrowserFrame.nativeLoadUrl(Native Method)
06-27 12:02:44.746: WARN/System.err(6692):     at android.webkit.BrowserFrame.loadUrl(BrowserFrame.java:248)
06-27 12:02:44.746: WARN/System.err(6692):     at android.webkit.WebViewCore.loadUrl(WebViewCore.java:1564)
06-27 12:02:44.746: WARN/System.err(6692):     at android.webkit.WebViewCore.access$1400(WebViewCore.java:52)
06-27 12:02:44.746: WARN/System.err(6692):     at android.webkit.WebViewCore$EventHub$1.handleMessage(WebViewCore.java:950)
06-27 12:02:44.746: WARN/System.err(6692):     at android.os.Handler.dispatchMessage(Handler.java:99)
06-27 12:02:44.746: WARN/System.err(6692):     at android.os.Looper.loop(Looper.java:123)
06-27 12:02:44.746: WARN/System.err(6692):     at android.webkit.WebViewCore$WebCoreThread.run(WebViewCore.java:623)
06-27 12:02:44.746: WARN/System.err(6692):     at java.lang.Thread.run(Thread.java:1096)
06-27 12:02:44.746: WARN/dalvikvm(6692): threadid=8: thread exiting with uncaught exception (group=0x40020ac0)
06-27 12:02:44.756: ERROR/AndroidRuntime(6692): FATAL EXCEPTION: WebViewCoreThread
06-27 12:02:44.756: ERROR/AndroidRuntime(6692): java.lang.OutOfMemoryError
06-27 12:02:44.756: ERROR/AndroidRuntime(6692):     at java.lang.AbstractStringBuilder.enlargeBuffer(AbstractStringBuilder.java:97)
06-27 12:02:44.756: ERROR/AndroidRuntime(6692):     at java.lang.AbstractStringBuilder.append0(AbstractStringBuilder.java:157)
06-27 12:02:44.756: ERROR/AndroidRuntime(6692):     at java.lang.StringBuilder.append(StringBuilder.java:217)
06-27 12:02:44.756: ERROR/AndroidRuntime(6692):     at android.webkit.BrowserFrame.startLoadingResource(BrowserFrame.java:710)
06-27 12:02:44.756: ERROR/AndroidRuntime(6692):     at android.webkit.BrowserFrame.nativeLoadUrl(Native Method)
06-27 12:02:44.756: ERROR/AndroidRuntime(6692):     at android.webkit.BrowserFrame.loadUrl(BrowserFrame.java:248)
06-27 12:02:44.756: ERROR/AndroidRuntime(6692):     at android.webkit.WebViewCore.loadUrl(WebViewCore.java:1564)
06-27 12:02:44.756: ERROR/AndroidRuntime(6692):     at android.webkit.WebViewCore.access$1400(WebViewCore.java:52)
06-27 12:02:44.756: ERROR/AndroidRuntime(6692):     at android.webkit.WebViewCore$EventHub$1.handleMessage(WebViewCore.java:950)
06-27 12:02:44.756: ERROR/AndroidRuntime(6692):     at android.os.Handler.dispatchMessage(Handler.java:99)
06-27 12:02:44.756: ERROR/AndroidRuntime(6692):     at android.os.Looper.loop(Looper.java:123)
06-27 12:02:44.756: ERROR/AndroidRuntime(6692):     at android.webkit.WebViewCore$WebCoreThread.run(WebViewCore.java:623)
06-27 12:02:44.756: ERROR/AndroidRuntime(6692):     at java.lang.Thread.run(Thread.java:1096)

The strange thing is, DDMS Heap view shows it had plenty of “Free” memory, but it still may give an error such as:

ERROR/dalvikvm-heap(10612): Out of memory on a 1153232-byte allocation.

I don’t know if it’s at all related, but sometimes it gives this warning when opening a page, before out-of-memory:

ERROR/Web Console(18033): SECURITY_ERR: DOM Exception 18: An attempt was made to break through the security policy of the user agent. at …

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-23T12:01:07+00:00Added an answer on May 23, 2026 at 12:01 pm

    I switched to loadDataWithBaseURL, which doesn’t require URLEncoder encoding the url, and doesn’t keep huge data urls in the history. This seems to have fixed the high cpu use and memory leak, and the SECURITY_ERR:

    WebView.loadDataWithBaseURL(url,data,"text/html","UTF-8",url);
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

link Im having trouble converting the html entites into html characters, (&# 8217;) i
That's pretty much it. I'm using Nokogiri to scrape a web page what has
I used javascript for loading a picture on my website depending on which small
this is what i have right now Drawing an RSS feed into the php,
I'm using v2.0 of ClassTextile.php, with the following call: $testimonial_text = $textile->TextileRestricted($_POST['testimonial']); ... and
I want use html5's new tag to play a wav file (currently only supported
Seemingly simple, but I cannot find anything relevant on the web. What is the
Does anyone know how can I replace this 2 symbol below from the string
I'm trying to decode HTML entries from here NYTimes.com and I cannot figure out
I have just tried to save a simple *.rtf file with some websites and

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.