2011-02-05 80 views
0

我剛剛從市場錯誤報告中得到了這個堆棧跟蹤,不知道在哪裏跟蹤問題,任何幫助表示讚賞。java.lang.OutOfMemoryError位圖創建?

java.lang.OutOfMemoryError: bitmap size exceeds VM budget 
at android.graphics.Bitmap.nativeCreate(Native Method) 
at android.graphics.Bitmap.createBitmap(Bitmap.java:477) 
at android.graphics.Bitmap.createBitmap(Bitmap.java:444) 
at android.graphics.Bitmap.createScaledBitmap(Bitmap.java:349) 
at android.graphics.BitmapFactory.finishDecode(BitmapFactory.java:488) 
at android.graphics.BitmapFactory.decodeStream(BitmapFactory.java:463) 
at android.graphics.BitmapFactory.decodeResourceStream(BitmapFactory.java:326) 
at android.graphics.drawable.Drawable.createFromResourceStream(Drawable.java:697) 
at android.content.res.Resources.loadDrawable(Resources.java:1709) 
at android.content.res.Resources.getDrawable(Resources.java:581) 
at com.android.internal.view.menu.MenuItemImpl.getIcon(MenuItemImpl.java:440) 
at com.android.internal.view.menu.IconMenuItemView.initialize(IconMenuItemView.java:109) 
at com.android.internal.view.menu.MenuItemImpl.createItemView(MenuItemImpl.java:594) 
at com.android.internal.view.menu.MenuItemImpl.getItemView(MenuItemImpl.java:577) 
at com.android.internal.view.menu.IconMenuView.updateChildren(IconMenuView.java:351) 
at com.android.internal.view.menu.IconMenuView.initialize(IconMenuView.java:333) 
at com.android.internal.view.menu.MenuBuilder$MenuType.getMenuView(MenuBuilder.java:199) 
at com.android.internal.view.menu.MenuBuilder.getMenuView(MenuBuilder.java:323) 
at com.android.internal.policy.impl.PhoneWindow.initializePanelContent(PhoneWindow.java:858) 
at com.android.internal.policy.impl.PhoneWindow.openPanel(PhoneWindow.java:435) 
at com.android.internal.policy.impl.PhoneWindow.onKeyUpPanel(PhoneWindow.java:621) 
at com.android.internal.policy.impl.PhoneWindow.onKeyUp(PhoneWindow.java:1339) 
at com.android.internal.policy.impl.PhoneWindow$DecorView.dispatchKeyEvent(PhoneWindow.java:1668) 
at android.view.ViewGroup.dispatchKeyEvent(ViewGroup.java:789) 
at android.view.ViewGroup.dispatchKeyEvent(ViewGroup.java:789) 
at android.view.ViewGroup.dispatchKeyEvent(ViewGroup.java:789) 
at android.widget.TabHost.dispatchKeyEvent(TabHost.java:278) 
at android.view.ViewGroup.dispatchKeyEvent(ViewGroup.java:789) 
at android.view.ViewGroup.dispatchKeyEvent(ViewGroup.java:789) 
at com.android.internal.policy.impl.PhoneWindow$DecorView.superDispatchKeyEvent(PhoneWindow.java:1687) 
at com.android.internal.policy.impl.PhoneWindow.superDispatchKeyEvent(PhoneWindow.java:1120) 
at android.app.Activity.dispatchKeyEvent(Activity.java:2073) 
at com.android.internal.policy.impl.PhoneWindow$DecorView.dispatchKeyEvent(PhoneWindow.java:1663) 
at android.view.ViewRoot.deliverKeyEventToViewHierarchy(ViewRoot.java:2560) 
at android.view.ViewRoot.handleFinishedEvent(ViewRoot.java:2535) 
at android.view.ViewRoot.handleMessage(ViewRoot.java:1867) 
at android.os.Handler.dispatchMessage(Handler.java:99) 
at android.os.Looper.loop(Looper.java:123) 
at android.app.ActivityThread.main(ActivityThread.java:3647) 
at java.lang.reflect.Method.invokeNative(Native Method) 
at java.lang.reflect.Method.invoke(Method.java:507) 
at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:839) 
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:597) 
at dalvik.system.NativeStart.main(Native Method) 

回答

1

我越來越對我已經爲Android 2.1和Android 2.2開發的,但是在Android 4.0.1 ICS運行的應用程序相同的錯誤。相同的應用程序會運行在Android 2.1上,但會導致ICS上面的錯誤崩潰。如果你正在畫屏幕大小相對較大的東西,請考慮從那個地方進行檢查。