0

We have submitted an application on Amazon Market, the uploaded .apk working perfectly on other Devices and my KFTT as well but when we or other users are downloading the app from Amazon Market it is causing OutofMEmoryError. We have used 1024X1024 as well as 2048X2048 sprite sheet in out game.

When we install the .apk manually it never crash but it always gets crash when we run it after downloading it from Amazon market. can someone please tell us what could the reason for it and how to tackle with it?

java.lang.OutOfMemoryError
at android.graphics.BitmapFactory.nativeDecodeAsset(Native Method)
at android.graphics.BitmapFactory.decodeStream(BitmapFactory.java:483)
at android.graphics.BitmapFactory.decodeStream(BitmapFactory.java:549)
at com.finoit.androidgames.framework.gl.Texture.load(Texture.java:42)
at com.finoit.androidgames.framework.gl.Texture.(Texture.java:30)
at com.finoit.androidgames.tapafish.Assets.load(Assets.java:458)
at com.finoit.androidgames.tapafish.FishTank.onSurfaceCreated(FishTank.java:23)
at android.opengl.GLSurfaceView$GLThread.guardedRun(GLSurfaceView.java:1446)
at android.opengl.GLSurfaceView$GLThread.run(GLSurfaceView.java:1216)
strike
  • 1,031
  • 8
  • 24
  • stacktrace from logcat? – Sankar V Apr 06 '13 at 07:59
  • You really need to see what's eating the memory. Attach a KF to a debugger and take some hprofs, see what's actually eating the memory. But remember that every device has a different setting for what the maximum amount of memory an app can use is- KF may be low. – Gabe Sechan Apr 06 '13 at 08:00
  • assuming something in the Amazon process is reducing the available memory slightly how close to the heap size are you to start with? Are you disposing of bitmaps as soon as you can? – Offbeatmammal Apr 11 '13 at 00:15

1 Answers1

0

I have the same behaviour: out of memory on amazon hd 8,9 , beside it is size is same as in nexus 10 who works very good with 64 mb.

As fastest solution, I have add largeHeap option to AndroidManifest, which give you more memory, theoritcly up to 256 mb if needs. Try it as simplest solution for moment.

....

Also, if you want to optimize, try DDMS with MAT, to understand the biggest parts of allocated memory. When you find the biggest pieces ,normally this is bitmaps, you can always load them with help of bitmapFactory with scale lower than hdpi(amazon default density for most of devices), it really economize memory.

Sergey Vakulenko
  • 1,655
  • 18
  • 23