jPCT-AE - a 3d engine for Android > Support

OutOfMemoryError on ICS

(1/3) > >>

Thomas.:
Application crashes during the loading with this error log. On gingerbread without any problem.


--- Code: ---11-30 11:09:33.691: W/dalvikvm(21679): threadid=14: thread exiting with uncaught exception (group=0x40a321f8)
11-30 11:09:33.695: E/AndroidRuntime(21679): FATAL EXCEPTION: Thread-7392
11-30 11:09:33.695: E/AndroidRuntime(21679): java.lang.OutOfMemoryError
11-30 11:09:33.695: E/AndroidRuntime(21679): at android.graphics.BitmapFactory.nativeDecodeStream(Native Method)
11-30 11:09:33.695: E/AndroidRuntime(21679): at android.graphics.BitmapFactory.decodeStream(BitmapFactory.java:493)
11-30 11:09:33.695: E/AndroidRuntime(21679): at android.graphics.BitmapFactory.decodeStream(BitmapFactory.java:549)
11-30 11:09:33.695: E/AndroidRuntime(21679): at com.threed.jpct.util.BitmapHelper.loadImage(BitmapHelper.java:32)
11-30 11:09:33.695: E/AndroidRuntime(21679): at com.threed.jpct.Texture.loadTexture(Texture.java:715)
11-30 11:09:33.695: E/AndroidRuntime(21679): at com.threed.jpct.Texture.loadTexture(Texture.java:703)
11-30 11:09:33.695: E/AndroidRuntime(21679): at com.threed.jpct.Texture.<init>(Texture.java:135)
11-30 11:09:33.695: E/AndroidRuntime(21679): at cz.game.util.ObjectLoader.loadValuesOfObjects(ObjectLoader.java:471)
11-30 11:09:33.695: E/AndroidRuntime(21679): at cz.game.util.ObjectLoader.loadLevel(ObjectLoader.java:314)
11-30 11:09:33.695: E/AndroidRuntime(21679): at cz.game.util.ObjectLoader.load(ObjectLoader.java:203)
11-30 11:09:33.695: E/AndroidRuntime(21679): at cz.game.util.ObjectLoader.run(ObjectLoader.java:116)
11-30 11:09:33.703: W/ActivityManager(188):   Force finishing activity com.main/cz.game.main.Demo

--- End code ---

EgonOlsen:
No idea. I'm not doing anything OS related anywhere in the code. Maybe this relates to this: http://www.jpct.net/forum2/index.php/topic,2429.0.html?

Edit: What's the default VM memory size on that device? Maybe it's lower than on the Gingerbread device...

K24A3:
I have the same problem with Honeycomb. For some reason the app uses double the RAM compared to Gingerbread. You can use the new LargeHeap parameter in Android.Manifest to increase the RAM to 256MB but you will lose Gingerbread compatibility.

Use this function to see how much RAM is used in both gingerbread and ICS:


--- Code: --- public void logMem() {
        DecimalFormat df = new DecimalFormat();
        df.setMaximumFractionDigits(0);
        df.setMinimumFractionDigits(0);

        String sTemp = "RAM allocated: " + df.format(new Double(Runtime.getRuntime().totalMemory()/1048576)) + "MB of " + df.format(new Double(Runtime.getRuntime().maxMemory()/1048576))+ "MB (" + df.format(new Double(Runtime.getRuntime().freeMemory()/1048576)) +"MB free)";
        Log.v(TAG, sTemp);
    }

--- End code ---

Thomas.:
I think that on gingerbread was VM memory size 48Mb and now on ICS it is 32Mb... how can I reduce demands on this memory?
K24A3:

--- Code: ---11-30 12:24:57.277: I/jPCT-AE(22387): RAM allocated: 31MB of 32MB (0MB free)
11-30 12:24:57.414: I/dalvikvm-heap(22387): Clamp target GC heap from 32.692MB to 32.000MB
11-30 12:24:57.605: E/AndroidRuntime(22387): FATAL EXCEPTION: GLThread 7473
...
--- End code ---

EgonOlsen:
Have a had a look here: http://www.jpct.net/wiki/index.php/Reducing_memory_usage?

Navigation

[0] Message Index

[#] Next page

Go to full version