Is there a minimal heap size for Android versions?
Many posts have talked about Android heap size, and so far what I've found out is that the only common thing about max heap size is that it's at least 16MB, but that was the limit ever since API 3. For using more memory, people would suggest to use the NDK or anything that is beyond the "normal" Android development.
Is there any Android version that has a requirement from the devices to have a larger heap size, so that I could start assuming a larger one and stop being so cheap on memory?
Is there also a requirement about the flag of the large heap (from API 11 - honeycomb) inside the manifest, or is it a vague request that the device might even ignore it?
It's just that the Android hardware has improved so much over the years, yet we still need to be so cheap on memory even though devices now have more than 1GB of ram. And it's weird that we can't ask from the OS to get us a specific amount of heap size and promise it that we won't use any more of this.
ok, i've finally found the answer (thanks to this post) :
the bare minimal for all versions of android (including 5) , is 16MB.
the requirements for each of the android versions can be read about here:
http://source.android.com/compatibility/downloads.html
you can read about them by opening the CDD files and searching for "Runtime Compatibility" (or "Virtual Machine Compatibility" for old versions). also, you can find the minimal RAM requirement by searching for "Memory and Storage", but i think it's only the requirement for the system itself.
so, for example, on 4.0.3 - 5 the minimal heap size is:
I can't find the minimal heap size for versions 3.x but it's probably the same as 4.0.3 .
for 2.1 - 2.3 , the minimal heap size is :
Device implementations with screens classified as medium- or low-density MUST configure Dalvik to allocate at least 16MB of memory to each application. Device implementations with screens classified as high-density or extra-high-density MUST configure Dalvik to allocate at least 24MB of memory to each application. Note that device implementations MAY allocate more memory than these figures.
meaning:
i can't find the minimal heap size for version 1.6 , but it's probably the same as 2.1 .
also, i can't find out what should the large-heap flag do for each of the android versions (since 3.0) .
链接地址: http://www.djcxy.com/p/60622.html上一篇: 是否可以指定最小堆大小要求?
下一篇: Android版本是否有最小的堆大小?