仅在Marshmallow上访问“最近的应用程序”时,OutOfMemoryError会崩溃systemui

时间:2016-03-31 20:57:20

标签: android crash out-of-memory android-6.0-marshmallow

我正在开发一款效果不错的Android应用,除非在Android 6.0及更高版本上访问最近的应用列表。当我的应用程序打开时,当我点击最近的应用程序按钮时,com.android.systemui将崩溃并显示以下堆栈跟踪:

03-31 15:40:22.291 23442-23442/? E/MessageQueue-JNI: Exception in MessageQueue callback: handleReceiveCallback
03-31 15:40:22.318 23442-23442/? E/MessageQueue-JNI: java.lang.OutOfMemoryError: Failed to allocate a 119596108 byte allocation with 16777216 free bytes and 57MB 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:1080)
                                                         at android.content.res.Resources.loadDrawableForCookie(Resources.java:2598)
                                                         at android.content.res.Resources.loadDrawable(Resources.java:2503)
                                                         at android.content.res.Resources.getDrawable(Resources.java:806)
                                                         at android.app.ApplicationPackageManager.getDrawable(ApplicationPackageManager.java:836)
                                                         at android.app.ApplicationPackageManager.loadUnbadgedItemIcon(ApplicationPackageManager.java:2069)
                                                         at android.app.ApplicationPackageManager.loadItemIcon(ApplicationPackageManager.java:2049)
                                                         at android.content.pm.PackageItemInfo.loadIcon(PackageItemInfo.java:155)
                                                         at android.content.pm.ComponentInfo.loadDefaultIcon(ComponentInfo.java:184)
                                                         at android.app.ApplicationPackageManager.loadUnbadgedItemIcon(ApplicationPackageManager.java:2072)
                                                         at android.app.ApplicationPackageManager.loadItemIcon(ApplicationPackageManager.java:2049)
                                                         at android.content.pm.PackageItemInfo.loadIcon(PackageItemInfo.java:155)
                                                         at com.android.systemui.recents.misc.SystemServicesProxy.getActivityIcon(SystemServicesProxy.java:488)
                                                         at com.android.systemui.recents.model.RecentsTaskLoader.getAndUpdateActivityIcon(RecentsTaskLoader.java:407)
                                                         at com.android.systemui.recents.model.RecentsTaskLoadPlan.executePlan(RecentsTaskLoadPlan.java:238)
                                                         at com.android.systemui.recents.model.RecentsTaskLoader.loadTasks(RecentsTaskLoader.java:477)
                                                         at com.android.systemui.recents.Recents.preloadIcon(Recents.java:690)
                                                         at com.android.systemui.recents.Recents.preCacheThumbnailTransitionBitmapAsync(Recents.java:699)
                                                         at com.android.systemui.recents.Recents.preloadRecentsInternal(Recents.java:402)
                                                         at com.android.systemui.recents.Recents.preloadRecents(Recents.java:382)
                                                         at com.android.systemui.statusbar.BaseStatusBar.preloadRecents(BaseStatusBar.java:1139)
                                                         at com.android.systemui.statusbar.BaseStatusBar$7.onTouch(BaseStatusBar.java:1102)
                                                         at android.view.View.dispatchTouchEvent(View.java:9296)
                                                         at android.view.ViewGroup.dispatchTransformedTouchEvent(ViewGroup.java:2553)
                                                         at android.view.ViewGroup.dispatchTouchEvent(ViewGroup.java:2197)
                                                         at android.view.ViewGroup.dispatchTransformedTouchEvent(ViewGroup.java:2553)
                                                         at android.view.ViewGroup.dispatchTouchEvent(ViewGroup.java:2197)
                                                         at android.view.ViewGroup.dispatchTransformedTouchEvent(ViewGroup.java:2553)
                                                         at android.view.ViewGroup.dispatchTouchEvent(ViewGroup.java:2197)
                                                         at android.view.View.dispatchPointerEvent(View.java:9520)
                                                         at android.view.ViewRootImpl$ViewPostImeInputStage.processPointerEvent(ViewRootImpl.java:4238)
                                                         at android.view.ViewRootImpl$ViewPostImeInputStage.onProcess(ViewRootImpl.java:4104)
                                                         at android.view.ViewRootImpl$InputStage.deliver(ViewRootImpl.java:3650)
                                                         at android.view.ViewRootImpl$InputStage.onDeliverToNext(ViewRootImpl.java:3703)
                                                         at android.view.ViewRootImpl$InputStage.forward(ViewRootImpl.java:3669)
                                                         at android.view.ViewRootImpl$AsyncInputStage.forward(ViewRootImpl.java:3795)
                                                         at android.view.ViewRootImpl$InputStage.apply(ViewRootImpl.java:3677)
                                                         at android.view.ViewRootImpl$AsyncInputStage.apply(ViewRootImpl.java:3852)
                                                         at android.view.ViewRootImpl$InputStage.deliver(ViewRootImpl.java:3650)
                                                         at android.view.ViewRootImpl$InputStage.onDeliverToNext(ViewRootImpl.java:3703)
                                                         at android.view.ViewRootImpl$InputStage.forward(ViewRootImpl.java:3669)
                                                         at android.view.ViewRootImpl$InputStage.apply(ViewRootImpl.java:3677)
                                                         at android.view.ViewRootImpl$InputStage.deliver(ViewRootImpl.java:3650)
                                                         at android.view.ViewRootImpl.deliverInputEvent(ViewRootImpl.java:5932)
                                                         at android.view.ViewRootImpl.doProcessInputEvents(ViewRootImpl.java:5906)
                                                        at android.view.ViewRootImpl.enqueueInputEvent(Vie
03-31 15:40:22.321 23442-23442/? E/AndroidRuntime: FATAL EXCEPTION: main
                                                   Process: com.android.systemui, PID: 23442
                                                   java.lang.OutOfMemoryError: Failed to allocate a 119596108 byte allocation with 16777216 free bytes and 57MB 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:1080)
                                                       at android.content.res.Resources.loadDrawableForCookie(Resources.java:2598)
                                                       at android.content.res.Resources.loadDrawable(Resources.java:2503)
                                                       at android.content.res.Resources.getDrawable(Resources.java:806)
                                                       at android.app.ApplicationPackageManager.getDrawable(ApplicationPackageManager.java:836)
                                                       at android.app.ApplicationPackageManager.loadUnbadgedItemIcon(ApplicationPackageManager.java:2069)
                                                       at android.app.ApplicationPackageManager.loadItemIcon(ApplicationPackageManager.java:2049)
                                                       at android.content.pm.PackageItemInfo.loadIcon(PackageItemInfo.java:155)
                                                       at android.content.pm.ComponentInfo.loadDefaultIcon(ComponentInfo.java:184)
                                                       at android.app.ApplicationPackageManager.loadUnbadgedItemIcon(ApplicationPackageManager.java:2072)
                                                       at android.app.ApplicationPackageManager.loadItemIcon(ApplicationPackageManager.java:2049)
                                                       at android.content.pm.PackageItemInfo.loadIcon(PackageItemInfo.java:155)
                                                       at com.android.systemui.recents.misc.SystemServicesProxy.getActivityIcon(SystemServicesProxy.java:488)
                                                       at com.android.systemui.recents.model.RecentsTaskLoader.getAndUpdateActivityIcon(RecentsTaskLoader.java:407)
                                                       at com.android.systemui.recents.model.RecentsTaskLoadPlan.executePlan(RecentsTaskLoadPlan.java:238)
                                                       at com.android.systemui.recents.model.RecentsTaskLoader.loadTasks(RecentsTaskLoader.java:477)
                                                       at com.android.systemui.recents.Recents.preloadIcon(Recents.java:690)
                                                       at com.android.systemui.recents.Recents.preCacheThumbnailTransitionBitmapAsync(Recents.java:699)
                                                       at com.android.systemui.recents.Recents.preloadRecentsInternal(Recents.java:402)
                                                       at com.android.systemui.recents.Recents.preloadRecents(Recents.java:382)
                                                       at com.android.systemui.statusbar.BaseStatusBar.preloadRecents(BaseStatusBar.java:1139)
                                                       at com.android.systemui.statusbar.BaseStatusBar$7.onTouch(BaseStatusBar.java:1102)
                                                       at android.view.View.dispatchTouchEvent(View.java:9296)
                                                       at android.view.ViewGroup.dispatchTransformedTouchEvent(ViewGroup.java:2553)
                                                       at android.view.ViewGroup.dispatchTouchEvent(ViewGroup.java:2197)
                                                       at android.view.ViewGroup.dispatchTransformedTouchEvent(ViewGroup.java:2553)
                                                       at android.view.ViewGroup.dispatchTouchEvent(ViewGroup.java:2197)
                                                       at android.view.ViewGroup.dispatchTransformedTouchEvent(ViewGroup.java:2553)
                                                       at android.view.ViewGroup.dispatchTouchEvent(ViewGroup.java:2197)
                                                        at android.view.View.dispatchPointerEvent(View.java:9520)
                                                       at android.view.ViewRootImpl$ViewPostImeInputStage.processPointerEvent(ViewRootImpl.java:4238)
                                                       at android.view.ViewRootImpl$ViewPostImeInputStage.onProcess(ViewRootImpl.java:4104)
                                                       at android.view.ViewRootImpl$InputStage.deliver(ViewRootImpl.java:3650)
                                                       at android.view.ViewRootImpl$InputStage.onDeliverToNext(ViewRootImpl.java:3703)
                                                       at android.view.ViewRootImpl$InputStage.forward(ViewRootImpl.java:3669)
                                                       at android.view.ViewRootImpl$AsyncInputStage.forward(ViewRootImpl.java:3795)
                                                       at android.view.ViewRootImpl$InputStage.apply(ViewRootImpl.java:3677)
                                                       at android.view.ViewRootImpl$AsyncInputStage.apply(ViewRootImpl.java:3852)
                                                       at android.view.ViewRootImpl$InputStage.deliver(ViewRootImpl.java:3650)
                                                       at android.view.ViewRootImpl$InputStage.onDeliverToNext(ViewRootImpl.java:3703)
                                                       at android.view.ViewRootImpl$InputStage.forward(ViewRootImpl.java:3669)
                                                       at android.view.ViewRootImpl$InputStage.apply(ViewRootImpl.java:3677)
                                                       at android.view.ViewRootImpl$InputStage.deliver(ViewRootImpl.java:3650)
                                                       at android.view.ViewRootImpl.deliverInputEvent(ViewRootImpl.java:5932)
                                                       at android.view.ViewRootImpl.doProcessInputEvents(ViewRootImpl.
0

有时候最近的应用列表会成功显示,但点击按钮和显示列表之间存在很长的延迟。试图滚动浏览最近的应用程序也很慢。

我不确定如何调试此问题,我将不胜感激任何建议。设备监视器表明系统有足够的内存可供使用。

0 个答案:

没有答案