是否有一个最小堆大小的Andr​​oid版本? [英] Is there a minimal heap size for Android versions?

查看:139
本文介绍了是否有一个最小堆大小的Andr​​oid版本?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

很多帖子都谈到Android的堆大小,到目前为止,我所发现的是,有关最大堆大小的唯一共同的一点是,它至少16MB,不过那是极限自从API 3.对于使用更多的内存,人们会建议使用NDK或任何超出了正常Android开发。

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.

是否有具有从设备的要求有较大的堆大小,这样我就可以开始承担一个较大的一个,不要再对内存这么便宜的任何Android版本?

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?

时也有对大型堆(来自API 11 - 蜂巢)的标志要求的清单里面,还是一个模糊的要求,该设备甚至可以忽略它。

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?

这只是Android的硬件有很大提升,多年来,但我们仍然需要对内存这么便宜,即使设备现在已经超过的RAM为1GB。而它的怪异,我们不能从操作系统要求让我们堆大小的具体金额并承诺它,我们不会使用任何更多的这一点。

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) :

裸最小的所有版本的Andr​​oid(含5),为16MB。

the bare minimal for all versions of android (including 5) , is 16MB.

对于每个版本的Andr​​oid的要求,可这里读到:

the requirements for each of the android versions can be read about here:

http://source.android.com/compatibility/downloads.html

您可以通过打开CDD文件,搜索运行兼容性(或虚拟机兼容性的旧版本)阅读它们。此外,您还可以通过搜索内存和存储找到的最低RAM要求,但我认为这只是针对系统本身的要求。

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.

因此​​,例如,4.0.3上 - 5最小堆大小是:

so, for example, on 4.0.3 - 5 the minimal heap size is:

  • 16MB:小/正常,LDPI / MDPI,或用大LDPI
  • 32MB:小/正常,tvhdpi /华电国际,或用大MDPI
  • 64MB:小/正常,xhdpi,或用大tvdpi /华电国际,或XLARGE与MDPI
  • 96MB:小/正常,400DPI,或XLARGE与tvhdpi /华电国际
  • 128MB:小/正常,xxhdpi,或用大xhdpi
  • 192MB:小/正常,560dpi,或用大400dpi的,或XLARGE与xhdpi
  • 256MB:小/正常,xxxhdpi,或用大xxhdpi
  • 288MB:XLARGE与400DPI
  • 384MB:大与560dpi,或XLARGE与xxhdpi
  • 512MB:大与xxxhdpi
  • 576MB:XLARGE与560dpi
  • 768MB:XLARGE与xxxhdpi
  • 16MB: small/normal with ldpi/mdpi, or large with ldpi
  • 32MB: small/normal with tvhdpi/hdpi, or large with mdpi
  • 64MB: small/normal with xhdpi, or large with tvdpi/hdpi, or xlarge with mdpi.
  • 96MB: small/normal with 400dpi, or xlarge with tvhdpi/hdpi
  • 128MB: small/normal with xxhdpi, or large with xhdpi
  • 192MB: small/normal with 560dpi, or large with 400dpi, or xlarge with xhdpi .
  • 256MB: small/normal with xxxhdpi, or large with xxhdpi
  • 288MB: xlarge with 400dpi
  • 384MB: large with 560dpi, or xlarge with xxhdpi
  • 512MB: large with xxxhdpi
  • 576MB: xlarge with 560dpi
  • 768MB: xlarge with xxxhdpi

我找不到最小堆大小版本3.x,但它可能是一样的4.0.3。

I can't find the minimal heap size for versions 3.x but it's probably the same as 4.0.3 .

2.1 - 2.3,最小堆大小为:

for 2.1 - 2.3 , the minimal heap size is :

设备与归类为中等或屏幕实现   低密度必须配置的Dalvik分配至少16MB的内存   向每个应用程序。与分类为屏幕设备实现   高密度或超高密度必须配置的Dalvik分配   至少24MB的存储器,以每个应用程序。需要注意的是设备   实现可以分配更多的内存比这些数字。

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.

含义:

  • 中屏幕或LDPI - 16MB
  • 华电国际和xhdpi - 24MB

我无法找到的最小堆大小为1.6版本,但它可能是一样的2.1。

i can't find the minimal heap size for version 1.6 , but it's probably the same as 2.1 .

另外,我无法找出什么要大堆标志做各的Andr​​oid版本(自3.0)。

also, i can't find out what should the large-heap flag do for each of the android versions (since 3.0) .

这篇关于是否有一个最小堆大小的Andr​​oid版本?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆