【问题标题】:Android WebView Out of memory allocationAndroid WebView 内存分配不足
【发布时间】:2014-02-18 17:07:34
【问题描述】:

我有一个显示来自 uri 的位图的 WebView。它在前 7 或 8 次加载时运行良好,但在加载时出现此错误。需要帮助。

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

【问题讨论】:

  • 也发布您的代码。

标签: android memory webview out


【解决方案1】:

【讨论】:

    【解决方案2】:

    您是否考虑过在 WebView 上实现 onLowMemory() 和使用 freeMemory?您也可以使用 clearCache。另一个考虑因素是更改缓存模式。

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2015-08-15
      • 1970-01-01
      • 2011-01-11
      • 1970-01-01
      • 2012-06-13
      • 1970-01-01
      相关资源
      最近更新 更多