Hello,
I made a game called ‘Super Luminal’ (https://play.google.com/store/apps/details?id=com.olivier_mouren.super_luminal&hl=fr) and I have out of memory issue (lot of user report me the error, friends too).
I tried the largeHeap option but without sucess : my game crash at the startup (when I preload all my image files one per one) on low-end devices. In fact, my friend have this problem with his Xperia Go and users from the Google Play too with, for exemple, Galaxy S2.
Here the report from Google Play :
java.lang.RuntimeException: java.lang.OutOfMemoryError Java Stack Trace: com.ansca.corona.NativeToJavaBridge.getBitmapAsset(NativeToJavaBridge.java:1114) com.ansca.corona.NativeToJavaBridge.callGetBitmapAsset(NativeToJavaBridge.java:1394) com.ansca.corona.JavaToNativeShim.nativeResize(Native Method) com.ansca.corona.JavaToNativeShim.resize(JavaToNativeShim.java:212) com.ansca.corona.opengl.CoronaGLSurfaceView$CoronaRenderer.onSurfaceChanged(CoronaGLSurfaceView.java:355) com.ansca.corona.opengl.GLSurfaceView$GLThread.guardedRun(GLSurfaceView.java:1611) com.ansca.corona.opengl.GLSurfaceView$GLThread.run(GLSurfaceView.java:1377) stack traceback: [C]: ? [C]: in function 'newImage' ?: in main chunk [C]: in function 'require' ?: in function \<?:982\> (tail call): ? (tail call): ? ?: in main chunk
Here is my script that preload all my image file
local images = {"bullet.png", "explosion.png",...} -- Just a table with all my image file name local i=1 while(i\<=table.getn(images)) do local loaded\_image = display.newImage(images[i],0,0) loaded\_image.isVisible=false i=i+1 end
My game is ~8/9MB (‘old’ version on the Google Play is 13MB).
I hope you have some tips to solve this problem.