0

I'm getting this error when trying to go go back to an Activity in my emulator with API level 15.

02-27 09:20:54.282: E/dalvikvm-heap(629): Out of memory on a 17040400-byte allocation.
02-27 09:20:54.343: E/AndroidRuntime(629): FATAL EXCEPTION: main
02-27 09:20:54.343: E/AndroidRuntime(629): java.lang.OutOfMemoryError
02-27 09:20:54.343: E/AndroidRuntime(629):  at android.graphics.BitmapFactory.nativeDecodeAsset(Native Method)
02-27 09:20:54.343: E/AndroidRuntime(629):  at android.graphics.BitmapFactory.decodeStream(BitmapFactory.java:483)
02-27 09:20:54.343: E/AndroidRuntime(629):  at android.graphics.BitmapFactory.decodeResourceStream(BitmapFactory.java:351)
02-27 09:20:54.343: E/AndroidRuntime(629):  at android.graphics.BitmapFactory.decodeResource(BitmapFactory.java:374)
02-27 09:20:54.343: E/AndroidRuntime(629):  at android.graphics.BitmapFactory.decodeResource(BitmapFactory.java:404)
02-27 09:20:54.343: E/AndroidRuntime(629):  at com.visma.sandbox.rotatingmenu.v.BitmapResourceSet.loadBitmap(BitmapResourceSet.java:92)
02-27 09:20:54.343: E/AndroidRuntime(629):  at com.visma.sandbox.rotatingmenu.v.BitmapResourceSet.loadAndCacheBitmap(BitmapResourceSet.java:84)
02-27 09:20:54.343: E/AndroidRuntime(629):  at com.visma.sandbox.rotatingmenu.v.BitmapResourceSet.load(BitmapResourceSet.java:49)
02-27 09:20:54.343: E/AndroidRuntime(629):  at com.visma.sandbox.RotatingMenuSurface.loadBitmapResourceSet(RotatingMenuSurface.java:118)
02-27 09:20:54.343: E/AndroidRuntime(629):  at com.visma.sandbox.RotatingMenuSurface.surfaceCreated(RotatingMenuSurface.java:69)
02-27 09:20:54.343: E/AndroidRuntime(629):  at android.view.SurfaceView.updateWindow(SurfaceView.java:533)
02-27 09:20:54.343: E/AndroidRuntime(629):  at android.view.SurfaceView.onWindowVisibilityChanged(SurfaceView.java:226)
02-27 09:20:54.343: E/AndroidRuntime(629):  at android.view.View.dispatchWindowVisibilityChanged(View.java:5839)
02-27 09:20:54.343: E/AndroidRuntime(629):  at android.view.ViewGroup.dispatchWindowVisibilityChanged(ViewGroup.java:945)
02-27 09:20:54.343: E/AndroidRuntime(629):  at android.view.ViewGroup.dispatchWindowVisibilityChanged(ViewGroup.java:945)
02-27 09:20:54.343: E/AndroidRuntime(629):  at android.view.ViewGroup.dispatchWindowVisibilityChanged(ViewGroup.java:945)
02-27 09:20:54.343: E/AndroidRuntime(629):  at android.view.ViewRootImpl.performTraversals(ViewRootImpl.java:965)
02-27 09:20:54.343: E/AndroidRuntime(629):  at android.view.ViewRootImpl.handleMessage(ViewRootImpl.java:2442)
02-27 09:20:54.343: E/AndroidRuntime(629):  at android.os.Handler.dispatchMessage(Handler.java:99)
02-27 09:20:54.343: E/AndroidRuntime(629):  at android.os.Looper.loop(Looper.java:137)
02-27 09:20:54.343: E/AndroidRuntime(629):  at android.app.ActivityThread.main(ActivityThread.java:4424)
02-27 09:20:54.343: E/AndroidRuntime(629):  at java.lang.reflect.Method.invokeNative(Native Method)
02-27 09:20:54.343: E/AndroidRuntime(629):  at java.lang.reflect.Method.invoke(Method.java:511)
02-27 09:20:54.343: E/AndroidRuntime(629):  at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:784)
02-27 09:20:54.343: E/AndroidRuntime(629):  at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:551)
02-27 09:20:54.343: E/AndroidRuntime(629):  at dalvik.system.NativeStart.main(Native Method)
02-27 09:23:09.022: E/InputDispatcher(90): channel '41643028 com.visma.sandbox/com.visma.sandbox.IncomeInfoMenu (server)' ~ Channel is unrecoverably broken and will be disposed!

Max VM heap size is 48 and device ram size is 512 but the weird thing is that with a different emulator with the exact same heap size and memory size but with API Level 16 it works just fine. It also works on emulators with API level 8 with heap size of 24 and my real device with API level 10.

Is there something special with API level 15 or should I ignore this as a emulator bug?

Thanks for response.

ppreetikaa
  • 1,149
  • 2
  • 15
  • 22
PaperThick
  • 2,749
  • 4
  • 24
  • 42
  • Look are your memory usage and figure out if you have memory leaks or similar. I'd never ignore a OOME as they are really annoying buggers. – Warpzit Feb 27 '13 at 09:39
  • try reffering http://voices.yahoo.com/android-virtual-machine-vm-out-memory-error-7342266.html?cat=59 as i think its again a os bug in releasing bitmap alocations – Athul Harikumar Feb 27 '13 at 09:46
  • Is it possible that the screen size that you have selected in the emulator is having an influence? – hack_on Feb 27 '13 at 13:14

1 Answers1

-1

Hi may be the issue is in Bitmap size or something or else Heap size is increase please check these posts this may be helpful to you

Out of memory error on android emulator, but not on device

OutOfMemory exception when loading bitmap from external storage

Community
  • 1
  • 1
androidgeek
  • 3,440
  • 1
  • 15
  • 27