I am new in android and I am interested in what are common approaches regarding memory. I mean are we constraint/cautious about memory?
For example in a typical java application I would consider 2.5MB for a data structure a small size set.
Is this considered huge for android apps?
-
1Check this out stackoverflow.com/questions/2630158/…VERT9x– VERT9x2015-05-12 21:22:07 +00:00Commented May 12, 2015 at 21:22
-
Yes, its fairly large. Not impossibly so, but a significant size. We don't have gigs of memory to work with here- we have 10s-100s of megs. Even less on low end and older phones, where we may only have 30-40MB.Gabe Sechan– Gabe Sechan2015-05-12 21:27:27 +00:00Commented May 12, 2015 at 21:27
-
@GabeSechan devices with 30-40MB RAM can't run Android 4.0, so if you set min API to 14 you get rid of them and you are still supporting 90+% of devices.Bojan Kseneman– Bojan Kseneman2015-05-12 21:38:41 +00:00Commented May 12, 2015 at 21:38
-
@BojanKseneman We're talking about for apps, not total memory. I suggest you look at devloping markets, there's lots of devices like that. And they run 4.0.Gabe Sechan– Gabe Sechan2015-05-12 21:59:56 +00:00Commented May 12, 2015 at 21:59
1 Answer
I mean are we constraint/cautious about memory?
In a word, yes.
Is [2.5MB] considered huge for android apps?
That depends a bit on the device, and to a lesser extent the Android OS version.
Each Android app has a heap size limit. Originally, this limit was 16MB. On such devices, 2.5MB would be considered to be fairly huge, insofar as it is chewing up a good-sized percentage of your heap. Newer Android devices tend to have more system RAM, and your heap limit can be larger (32MB, 48MB, etc.). However, Android One devices are newer ones aimed at emerging markets, where the whole device only has 512MB, and so a heap limit in the 16-24MB range is not out of the question.
I would not consider 2.5MB to be "a small size set".