Hello everyone,
I've been developing a new game for Android with the jPCT-AE. Recently I've faced a new problem, an error the occurs randomly. Here is the log:
01-03 15:16:01.262: ERROR/dalvikvm(2038): Out of memory: Heap Size=20231KB, Allocated=16823KB, Bitmap Size=4274KB
01-03 15:16:01.282: WARN/dalvikvm(2038): threadid=15: thread exiting with uncaught exception (group=0x4001b390)
01-03 15:16:01.282: ERROR/AndroidRuntime(2038): Uncaught handler: thread GLThread 10 exiting due to uncaught exception
01-03 15:16:01.282: ERROR/AndroidRuntime(2038): java.lang.OutOfMemoryError
01-03 15:16:01.282: ERROR/AndroidRuntime(2038): at com.threed.jpct.Texture.loadTexture(Texture.java:701)
01-03 15:16:01.282: ERROR/AndroidRuntime(2038): at com.threed.jpct.Texture.loadTexture(Texture.java:662)
01-03 15:16:01.282: ERROR/AndroidRuntime(2038): at com.threed.jpct.Texture.<init>(Texture.java:130)
01-03 15:16:01.282: ERROR/AndroidRuntime(2038): at android.jpct.screening.ScreenRenderer.onSurfaceChanged(ScreenRenderer.java:139)
01-03 15:16:01.282: ERROR/AndroidRuntime(2038): at android.opengl.GLSurfaceView$GLThread.guardedRun(GLSurfaceView.java:1122)
01-03 15:16:01.282: ERROR/AndroidRuntime(2038): at android.opengl.GLSurfaceView$GLThread.run(GLSurfaceView.java:977)
This Out of Memory error occurs often, but not always. Actually, sometimes I run my code (in a device) and everything works just fine, other times (without making any changes) I get this error.
I've looked after some performance issues, memory usage, this kind of stuff.. but I still get this error.
Any suggestions?
Thanks in advance