user3065901
user3065901

Reputation: 4778

Android WebView Out of memory allocation

I have a WebView that shows a bitmap from uri. It works well the first 7 or 8 times it is loaded but then when loading it i get this error. Need help please.

01-27 18:44:27.155  30480-30480/? E/dalvikvm-heap﹕ Out of memory on a 631816-byte allocation.
01-27 18:44:30.579  15859-15859/? E/MtpService﹕ In MTPAPP onReceive:android.intent.action.BATTERY_CHANGED
01-27 18:44:30.579  15859-15859/? E/MtpService﹕ battPlugged Type : 2
01-27 18:44:34.362    1704-8058/? E/Dumper﹕ 3: 48387128549: User action: dump logging  circular buffer and context
01-27 18:44:34.362    1705-2000/? E/Dumper﹕ 3: 48387128549: User action: dump logging circular buffer and context
01-27 18:44:34.362    1704-8058/? E/Dumper﹕ 4: 48387128579: Triggering circular buffer dump in /data/ste-debug
01-27 18:44:34.362    1705-2000/? E/Dumper﹕ 4: 48387128579: Triggering circular buffer dump in /data/ste-debug
01-27 18:44:35.023  30960-30971/? E/SQLiteLog﹕ (1) duplicate column name: EVENT_TYPE
01-27 18:44:35.123    2296-2296/? E/Launcher﹕ Error finding setting, default accessibility to not found: accessibility_enabled

Upvotes: 0

Views: 5497

Answers (2)

carlosmaciel
carlosmaciel

Reputation: 819

Are you recycling your bitmaps? Could you reduce the size of the images?

Please look at these links:

Strange out of memory issue while loading an image to a Bitmap object

Large images in WebView cause Out Of Memory

webview capturing causes out of memory exception

Upvotes: 2

Saggy
Saggy

Reputation: 624

Have you considered implementing onLowMemory() and using freeMemory on the WebView? You could also use clearCache. Another consideration would be to change the cache mode.

Upvotes: 1

Related Questions