android - Why do Samsung S1 and S2 allocating different heap size of memory for the same APP -


i'm developing android game application requires loading lot of images(png). used bitmapfactory.decodestream load images:

bitmapfactory.options opt = new bitmapfactory.options();  opt.inscaled = false;  opt.inpreferredconfig = bitmap.config.argb_8888;      bitmap bitmap = bitmapfactory.decodestream(context.getresources().openrawresource(context.getres‌​ources().getidentifier(filenames.get(i),"drawable",context.getpackagename())),nul‌​l,opt); 

it works fine on samsung s1 i9000(android 2.3.3). when test on samsung s2 i9100(android 4.1.2) crashes when load images.

i launched ddms check heap , found out weird. seems s1 allocated 5.494mb application, when s2 allocated on 43.280mb!

i appreciate if tell me why there's such big difference between these 2 phones.

screenshot image


Comments