java.lang.OutOfMemoryError:在OOM之前无法分配xxxxxxxxx字节分配*

时间:2017-08-10 20:28:31

标签: java android memory-management garbage-collection

是的,我已经检查了其他链接,但这似乎不是任何重复的问题,也不能解决StackOverflow上的任何一个问题。

类似的链接:

这个问题的链接正在处理图像,但恰恰相反,我只处理撤消功能,在自定义工具栏中设置为菜单。

关于这个的奇怪之处在于,我能够在我的模拟器中运行代码(虽然会导致一点延迟)但是无法在实时/真实设备上运行(小米Redmi Note 4)

GitHub来源:https://github.com/viditkothari/RoulettePredictor

日志详情:

08-11 01:37:27.522 6885-6946/studio.irisdesigns.roulettepredictor I/OpenGLRenderer: Initialized EGL, version 1.4
08-11 01:37:33.856 6885-6885/studio.irisdesigns.roulettepredictor I/ListPopupWindow: Could not find method setEpicenterBounds(Rect) on PopupWindow. Oh well.
08-11 01:37:33.930 6885-6895/studio.irisdesigns.roulettepredictor I/art: Clamp target GC heap from 194MB to 192MB
08-11 01:37:34.414 6885-6885/studio.irisdesigns.roulettepredictor I/art: Starting a blocking GC Alloc
08-11 01:37:34.414 6885-6885/studio.irisdesigns.roulettepredictor I/art: Starting a blocking GC Alloc
08-11 01:37:34.418 6885-6885/studio.irisdesigns.roulettepredictor I/art: Starting a blocking GC Alloc
08-11 01:37:34.427 6885-6885/studio.irisdesigns.roulettepredictor I/art: Clamp target GC heap from 194MB to 192MB
08-11 01:37:34.427 6885-6885/studio.irisdesigns.roulettepredictor I/art: Alloc partial concurrent mark sweep GC freed 61(2640B) AllocSpace objects, 0(0B) LOS objects, 7% free, 178MB/192MB, paused 140us total 8.863ms
08-11 01:37:34.428 6885-6885/studio.irisdesigns.roulettepredictor I/art: Starting a blocking GC Alloc
08-11 01:37:34.441 6885-6885/studio.irisdesigns.roulettepredictor I/art: Clamp target GC heap from 194MB to 192MB
08-11 01:37:34.442 6885-6885/studio.irisdesigns.roulettepredictor I/art: Alloc concurrent mark sweep GC freed 8(12KB) AllocSpace objects, 0(0B) LOS objects, 7% free, 178MB/192MB, paused 137us total 13.655ms
08-11 01:37:34.442 6885-6885/studio.irisdesigns.roulettepredictor I/art: Forcing collection of SoftReferences for 146MB allocation
08-11 01:37:34.442 6885-6885/studio.irisdesigns.roulettepredictor I/art: Starting a blocking GC Alloc
08-11 01:37:34.456 6885-6885/studio.irisdesigns.roulettepredictor I/art: Clamp target GC heap from 194MB to 192MB
08-11 01:37:34.456 6885-6885/studio.irisdesigns.roulettepredictor I/art: Alloc concurrent mark sweep GC freed 11(352B) AllocSpace objects, 0(0B) LOS objects, 7% free, 178MB/192MB, paused 136us total 13.215ms
08-11 01:37:34.456 6885-6885/studio.irisdesigns.roulettepredictor W/art: Throwing OutOfMemoryError "Failed to allocate a 153809616 byte allocation with 14153728 free bytes and 13MB until OOM"
08-11 01:37:34.456 6885-6885/studio.irisdesigns.roulettepredictor I/art: Starting a blocking GC Alloc
08-11 01:37:34.456 6885-6885/studio.irisdesigns.roulettepredictor I/art: Starting a blocking GC Alloc
08-11 01:37:34.460 6885-6885/studio.irisdesigns.roulettepredictor I/art: Starting a blocking GC Alloc
08-11 01:37:34.469 6885-6885/studio.irisdesigns.roulettepredictor I/art: Clamp target GC heap from 194MB to 192MB
08-11 01:37:34.469 6885-6885/studio.irisdesigns.roulettepredictor I/art: Alloc partial concurrent mark sweep GC freed 6(192B) AllocSpace objects, 0(0B) LOS objects, 7% free, 178MB/192MB, paused 138us total 8.848ms
08-11 01:37:34.470 6885-6885/studio.irisdesigns.roulettepredictor I/art: Starting a blocking GC Alloc
08-11 01:37:34.483 6885-6885/studio.irisdesigns.roulettepredictor I/art: Clamp target GC heap from 194MB to 192MB
08-11 01:37:34.483 6885-6885/studio.irisdesigns.roulettepredictor I/art: Alloc concurrent mark sweep GC freed 3(96B) AllocSpace objects, 0(0B) LOS objects, 7% free, 178MB/192MB, paused 136us total 13.059ms
08-11 01:37:34.484 6885-6885/studio.irisdesigns.roulettepredictor I/art: Forcing collection of SoftReferences for 146MB allocation
08-11 01:37:34.484 6885-6885/studio.irisdesigns.roulettepredictor I/art: Starting a blocking GC Alloc
08-11 01:37:34.497 6885-6885/studio.irisdesigns.roulettepredictor I/art: Clamp target GC heap from 194MB to 192MB
08-11 01:37:34.497 6885-6885/studio.irisdesigns.roulettepredictor I/art: Alloc concurrent mark sweep GC freed 3(96B) AllocSpace objects, 0(0B) LOS objects, 7% free, 178MB/192MB, paused 137us total 13.042ms
08-11 01:37:34.498 6885-6885/studio.irisdesigns.roulettepredictor W/art: Throwing OutOfMemoryError "Failed to allocate a 153809616 byte allocation with 14153728 free bytes and 13MB until OOM"
08-11 01:37:34.498 6885-6885/studio.irisdesigns.roulettepredictor D/skia: --- allocation failed for scaled bitmap
08-11 01:37:34.504 6885-6885/studio.irisdesigns.roulettepredictor D/AndroidRuntime: Shutting down VM


                                                                                    --------- beginning of crash
08-11 01:37:34.505 6885-6885/studio.irisdesigns.roulettepredictor E/AndroidRuntime: FATAL EXCEPTION: main
                                                                                    Process: studio.irisdesigns.roulettepredictor, PID: 6885
                                                                                    java.lang.OutOfMemoryError: Failed to allocate a 153809616 byte allocation with 14153728 free bytes and 13MB until OOM
                                                                                        at dalvik.system.VMRuntime.newNonMovableArray(Native Method)
                                                                                        at android.graphics.BitmapFactory.nativeDecodeAsset(Native Method)
                                                                                        at android.graphics.BitmapFactory.decodeStream(BitmapFactory.java:613)
                                                                                        at android.graphics.BitmapFactory.decodeResourceStream(BitmapFactory.java:446)
                                                                                        at android.graphics.drawable.Drawable.createFromResourceStream(Drawable.java:1080)
                                                                                        at android.content.res.Resources.createFromResourceStream(Resources.java:2952)
                                                                                        at android.content.res.Resources.loadDrawableForCookie(Resources.java:2684)
                                                                                        at android.content.res.Resources.loadDrawable(Resources.java:2580)
                                                                                        at android.content.res.MiuiResources.loadDrawable(MiuiResources.java:387)
                                                                                        at android.content.res.Resources.getDrawable(Resources.java:824)
                                                                                        at android.content.Context.getDrawable(Context.java:467)
                                                                                        at android.support.v4.content.ContextCompatApi21.getDrawable(ContextCompatApi21.java:30)
                                                                                        at android.support.v4.content.ContextCompat.getDrawable(ContextCompat.java:372)
                                                                                        at android.support.v7.widget.AppCompatDrawableManager.getDrawable(AppCompatDrawableManager.java:202)
                                                                                        at android.support.v7.widget.AppCompatDrawableManager.getDrawable(AppCompatDrawableManager.java:190)
                                                                                        at android.support.v7.content.res.AppCompatResources.getDrawable(AppCompatResources.java:100)
                                                                                        at android.support.v7.view.menu.MenuItemImpl.getIcon(MenuItemImpl.java:425)
                                                                                        at android.support.v7.view.menu.ListMenuItemView.initialize(ListMenuItemView.java:116)
                                                                                        at android.support.v7.view.menu.MenuAdapter.getView(MenuAdapter.java:100)
                                                                                        at android.support.v7.view.menu.MenuPopup.measureIndividualMenuWidth(MenuPopup.java:160)
                                                                                        at android.support.v7.view.menu.StandardMenuPopup.tryShow(StandardMenuPopup.java:153)
                                                                                        at android.support.v7.view.menu.StandardMenuPopup.show(StandardMenuPopup.java:187)
                                                                                        at android.support.v7.view.menu.MenuPopupHelper.showPopup(MenuPopupHelper.java:290)
                                                                                        at android.support.v7.view.menu.MenuPopupHelper.tryShow(MenuPopupHelper.java:175)
                                                                                        at android.support.v7.widget.ActionMenuPresenter$OpenOverflowRunnable.run(ActionMenuPresenter.java:803)
                                                                                        at android.os.Handler.handleCallback(Handler.java:739)
                                                                                        at android.os.Handler.dispatchMessage(Handler.java:95)
                                                                                        at android.os.Looper.loop(Looper.java:148)
                                                                                        at android.app.ActivityThread.main(ActivityThread.java:5438)
                                                                                        at java.lang.reflect.Method.invoke(Native Method)
                                                                                        at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:738)
                                                                                        at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:628)
08-11 01:37:34.515 6885-6885/studio.irisdesigns.roulettepredictor I/Process: Sending signal. PID: 6885 SIG: 9

0 个答案:

没有答案