java.lang.OutOfMemory Error

Hi I hope someone can help me on this. My app runs ok on apple devices but android builds  crashes every time users click on the back button. The app runs fine on android for hours but will crash every time the back button is hit(the home button works fine without any issues). When the app crashes it will only display a black screen and the only way to exit is the back button. This is the logcat error

I/Corona (22477): java.lang.OutOfMemoryError

I/Corona (22477): Java Stack Trace:

I/Corona (22477): com.ansca.corona.NativeToJavaBridge.getBitmapAsset(NativeToJavaBridge.java:1114)

I/Corona (22477): com.ansca.corona.NativeToJavaBridge.callGetBitmapAsset(NativeToJavaBridge.java:1394)

I/Corona (22477): com.ansca.corona.JavaToNativeShim.nativeResize(Native Method)

I/Corona (22477): com.ansca.corona.JavaToNativeShim.resize(JavaToNativeShim.java:212)

I/Corona (22477): com.ansca.corona.opengl.CoronaGLSurfaceView$CoronaRenderer.onSurfaceChanged(CoronaGLSurfaceView.java:355)

I/Corona (22477): com.ansca.corona.opengl.GLSurfaceView$GLThread.guardedRun(GLSurfaceView.java:1611)

I/Corona (22477): com.ansca.corona.opengl.GLSurfaceView$GLThread.run(GLSurfaceView.java:1377)

Seems to be having issues loading my spritesheet. Tried this approach 

local function onSystemEvent( event )

if event.type == “applicationExit” then

clean()

os.exit()

end

end

Runtime:addEventListener( “system”, onSystemEvent )

it mostly work but still crashes from time to time when the back button on the phone is hit. Another thing that works is by restarting the phone but that is not really much of a solution. I am not sure if this is a bug or not. 

Many Thanks

Dan

Anyone having this issue just download 2012.996 build. It seems that the latest builds have issues with loading huge sprite sheets. my app is now working without crashing. Only downside is I have to remove some plug-ins that are not supported by this build SIGH!!

You can add this:

settings = {     android =     {         largeHeap = true     } }

Into your build.settings and see if that helps.   See:
 

http://docs.coronalabs.com/guide/distribution/buildSettings/index.html

and scroll down to the “Large Heap” section.

Thanks Rob will give that a try and update you guys. Currently it is working with a late build.

Hi just want to share I downloaded the latest build and added on the build;

largeHeap = true 

App now is stable and no more black screen when loading my huge sprite sheet. Many Thanks

Anyone having this issue just download 2012.996 build. It seems that the latest builds have issues with loading huge sprite sheets. my app is now working without crashing. Only downside is I have to remove some plug-ins that are not supported by this build SIGH!!

You can add this:

settings = {     android =     {         largeHeap = true     } }

Into your build.settings and see if that helps.   See:
 

http://docs.coronalabs.com/guide/distribution/buildSettings/index.html

and scroll down to the “Large Heap” section.

Thanks Rob will give that a try and update you guys. Currently it is working with a late build.

Hi just want to share I downloaded the latest build and added on the build;

largeHeap = true 

App now is stable and no more black screen when loading my huge sprite sheet. Many Thanks