Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

What is the Samsung Galaxy S3's Heap Size?

I have a small animation (AnimationDrawable) that consists of 9 frames with resolution of 480x800.

When I was running that activity with the animation on my "old" SGS1 everything was fine. Now I got the S3 and the exact same code gave me an outofMemoryError. That's not what I'd expect of a QuadCore/1GB RAM mobile phone. When I reduced the resolution of the animation, everything worked fine.

Did they really reduce the memory/heap?

like image 214
Tobias Reich Avatar asked Aug 06 '12 18:08

Tobias Reich


2 Answers

Examine the /system/build.prop file and look for 'dalvik.vm.heapsize' - that supposedly is the value for memory heap size allowed for each application process

like image 118
Gary S. Avatar answered Jan 03 '23 13:01

Gary S.


On my S3 running Android 4.1.2 the max heap size is 64MB (67108864 bytes).

You get this number by calling Runtime.getRuntime().maxMemory();

I've seen mention of 256MB but this is most likely only for apps that have specified android:largeHeap in their manifest file.

like image 25
Espen Riskedal Avatar answered Jan 03 '23 14:01

Espen Riskedal