大哥们,我遇到一个Android上的问题,帮我看一下吧
最近有一个小项目 要安卓和ios都做,上头位图便宜用phonegap做,就这个安卓这个,所有的页面代码在一个activity里面,逻辑相当复杂,采用js和java代码交互的方式处理事件,有涉及到相机的代码存在,但是就是不能运行,表现在安装闪退,用命令安装的话导致systemUI挂掉,只有4.1可以正常运行,查看logcat是发生了OOM,实在是不知道咋整了 ,请各位帮我 看看,不胜感激.另附上部分logcat:
08-17 02:14:43.778 17343-17362/com.android.launcher I/art﹕ Alloc partial concurrent mark sweep GC freed 6(192B) AllocSpace objects, 0(0B) LOS objects, 28% free, 10MB/14MB, paused 890us total 28.396ms 08-17 02:14:43.847 17343-17362/com.android.launcher I/art﹕ Alloc concurrent mark sweep GC freed 3(96B) AllocSpace objects, 0(0B) LOS objects, 28% free, 10MB/14MB, paused 1.173ms total 66.945ms 08-17 02:14:43.847 17343-17362/com.android.launcher I/art﹕ Forcing collection of SoftReferences for 211MB allocation 08-17 02:14:43.910 17343-17362/com.android.launcher I/art﹕ Alloc concurrent mark sweep GC freed 3(96B) AllocSpace objects, 0(0B) LOS objects, 28% free, 10MB/14MB, paused 934us total 61.626ms 08-17 02:14:43.910 17343-17362/com.android.launcher E/art﹕ Throwing OutOfMemoryError "Failed to allocate a 221414412 byte allocation with 4194304 free bytes and 153MB until OOM" 08-17 02:14:43.959 17343-17362/com.android.launcher D/skia﹕ --- allocation failed for scaled bitmap 08-17 02:14:44.048 17343-17362/com.android.launcher E/AndroidRuntime﹕ FATAL EXCEPTION: launcher-loader Process: com.android.launcher, PID: 17343 java.lang.OutOfMemoryError: Failed to allocate a 221414412 byte allocation with 4194304 free bytes and 153MB until OOM at dalvik.system.VMRuntime.newNonMovableArray(Native Method) at android.graphics.BitmapFactory.nativeDecodeAsset(Native Method) at android.graphics.BitmapFactory.decodeStream(BitmapFactory.java:609) at android.graphics.BitmapFactory.decodeResourceStream(BitmapFactory.java:444) at android.graphics.drawable.Drawable.createFromResourceStream(Drawable.java:988) at android.content.res.Resources.loadDrawableForCookie(Resources.java:2474) at android.content.res.Resources.loadDrawable(Resources.java:2381) at android.content.res.Resources.getDrawableForDensity(Resources.java:870) at android.content.res.Resources.getDrawableForDensity(Resources.java:825) at android.content.pm.LauncherActivityInfo.getBadgedIcon(LauncherActivityInfo.java:161) at com.android.launcher2.IconCache.cacheLocked(IconCache.java:248) at com.android.launcher2.IconCache.getTitleAndIcon(IconCache.java:184) at com.android.launcher2.ApplicationInfo.<init>(ApplicationInfo.java:81) at com.android.launcher2.LauncherModel$LoaderTask.loadAllAppsByBatch(LauncherModel.java:1956) at com.android.launcher2.LauncherModel$LoaderTask.loadAndBindAllApps(LauncherModel.java:1845) at com.android.launcher2.LauncherModel$LoaderTask.run(LauncherModel.java:1151) at android.os.Handler.handleCallback(Handler.java:739) at android.os.Handler.dispatchMessage(Handler.java:95) at android.os.Looper.loop(Looper.java:135) at android.os.HandlerThread.run(HandlerThread.java:61) 08-17 02:14:44.063 485-12451/system_process W/ActivityManager﹕ Force finishing activity 1 com.android.launcher/com.android.launcher2.Launcher 08-17 02:14:44.254 485-974/system_process I/ActivityManager﹕ START u0 {act=android.intent.action.MAIN cat=[android.intent.category.HOME] flg=0x10000000 cmp=com.android.launcher/com.android.launcher2.Launcher} from uid 0 on display 0 08-17 02:14:44.295 485-974/system_process V/WindowManager﹕ addAppToken: AppWindowToken{3836891a token=Token{39a09bc5 ActivityRecord{1f2ff23c u0 com.android.launcher/com.android.launcher2.Launcher t9}}} to stack=0 task=9 at 0 08-17 02:14:46.613 17343-17343/com.android.launcher I/Choreographer﹕ Skipped 40 frames! The application may be doing too much work on its main thread. 08-17 02:14:47.319 485-648/system_process V/WindowManager﹕ Adding window Window{20929227 u0 com.android.launcher/com.android.launcher2.Launcher} at 2 of 5 (after Window{1dcdc699 u0 com.android.launcher/com.android.launcher2.Launcher EXITING}) 08-17 02:14:48.081 485-518/system_process I/ActivityManager﹕ Displayed com.android.launcher/com.android.launcher2.Launcher: +1s523ms
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(4)
我也碰到过,我的是因为图标太大的原因,把图标调小一点就好了
我的那个是图标那个图片太大了 几百KB了
大哥 请问你是怎么解决的呢
我也遇到同样的问题
AndroidRuntime: java.lang.OutOfMemoryError: Failed to allocate a 1216012 byte allocation with 160408 free bytes and 156KB until OOM
AndroidRuntime: at dalvik.system.VMRuntime.newNonMovableArray(Native Method)
内存不够啊。