小编Bal*_* IT的帖子

清除堆内存以获取内存不足异常

我知道有关内存不足的问题,但我找不到任何解决方案

在Bitmap Factory中我得到了内存异常,甚至使用

inSampleSize=1
Run Code Online (Sandbox Code Playgroud)

所以我习惯用try catch out of memory of exception来包围它,因为这是一个不好的做法

try{
   .........
   ......
}catch (OutOfMemoryError e)
            {}
Run Code Online (Sandbox Code Playgroud)

内存不足异常也被捕获但我的问题是我们抓住了这个异常之后

清除或重新分配GC的堆内存

有什么办法吗?

我用

的System.gc();

没有用请帮忙!!!!!!!

not even Bitmap also for GridView Orientation 
i found this exception
Clamp target GC heap from 17.333MB to 16.000MB
Out of memory on a 140416-byte allocation.
Run Code Online (Sandbox Code Playgroud)

memory android garbage-collection

8
推荐指数
1
解决办法
4039
查看次数

标签 统计

android ×1

garbage-collection ×1

memory ×1