安卓开发中应注意内存的释放,一旦加载图片或其他占用太多内存,此时就会发生OOM错误,即内存泄露。 在开发中,尤其应注意图片资源的释放。 1。背景图片和ImageView释放------尤其注意图片资源 如:
复制代码 2.确定不用的List,数组等参数 释放:Obj=null即可,list先clear(),在令其等于null;如内存紧张,可及时调用Syetem.gc()通知进行回收 |
Android的OutOfMemory解决
原创
©著作权归作者所有:来自51CTO博客作者wufanxin的原创作品,请联系作者获取转载授权,否则将追究法律责任
下一篇:Android的手机震动
提问和评论都可以,用心的回复会被更多人看到
评论
发布评论
相关文章
-
Android编译解决:Missing classes detected while running R8.
Android编译相关问题解决
Android 代码混淆 配置文件 -
java outofmemory 命令 outofmemory java heap
这个问题主要还是由这个问题 java.lang.OutOfMemoryError: Java heap space 引起的。第一次出现这样的的问题以后,引发了其他的问题。在网上一查可能是JAVA的堆栈设置太小的原因。 跟据网上的答案大致有这两种解决方法: 1、设置环境变量 解决方法:手动设置Heap size
java outofmemory 命令 tomcat java myeclipse hibernate