programing tip

다양한 휴대폰 / 장치 및 OS 버전의 Android 힙 크기

itbloger 2020. 10. 28. 07:50
반응형

다양한 휴대폰 / 장치 및 OS 버전의 Android 힙 크기


Android 휴대폰의 힙 크기가 OS 버전에 설정된 값에 따라 일정한 값인지 아니면 휴대폰 생산자가 결정할 수있는 설정인지 아는 사람이 있습니까?

힙 크기가 전화기의 RAM 양에 비례합니까?

사람들이 애플리케이션의 힙 크기가 16M이라고 말하는 기사 만 찾았습니다. 그러나이 기사는 조금 오래되었습니다. 예를 들어, 힙 크기는 특정 모델에서 약 20M에서 최대 24M까지 다양합니다. 이 전화는 768M의 RAM을 가지고 있습니다.


Android 휴대폰의 힙 크기가 OS 버전에 설정된 값에 따라 일정한 값인지 아니면 휴대폰 생산자가 결정할 수있는 설정인지 아는 사람이 있습니까?

기술적으로는 전화 생산자가 결정할 수있는 설정입니다. Android는 오픈 소스입니다. 최근에 살펴본 적은 없지만 힙 크기 요구 사항을 설명하는 호환성 정의 문서가 기억 나지 않습니다.

힙 크기가 전화기의 RAM 양에 비례합니까?

아니요, 고해상도 화면은 더 큰 비트 맵을 조작하려는 경향이 있기 때문에 화면 해상도에 더 많은 기반을 두는 경향이 있으므로 Google은 기기 제조업체가 준수 할 힙 크기 권장 사항을 만듭니다.

사람들이 애플리케이션의 힙 크기가 16M이라고 말하는 기사 만 찾았습니다.

StackOverflow를 검색 하면이 답변이[android] "heap size" 나타납니다 .


build.prop 파일에서 추출 된 추가 장치 정보 (adb -d pull /system/build.prop) :

휴대폰 (안드로이드 버전) :

  • HTC Wildfire (2.2.1) = 16MB
  • HTC Wildfire S (2.3.5) = 20MB
  • HTC Salsa (2.3.3) = 20MB
  • HTC Desire (2.3.3) = 32MB
  • HTC Desire S (2.3.5) = 32MB
  • Sprd-Richview-S111 (2.3.5) = 32MB
  • 삼성 Galaxy S GT-I9000 (2.2) = 48MB
  • 삼성 Galaxy R GT-I9103 (2.3.5) = 64MB
  • 삼성 Galaxy Y GT-S5360 (2.3.5) = 64MB
  • Samsung Galaxy Note N7000 (4.1.2) = heapstartsize = 8m, heapgrowthlimit = 64m, heapsize = 256m
  • 삼성 Galaxy S3 GT-I9300 (4.3, xhpdi) = 8 / 64 / 256MB
  • 삼성 Galaxy S4 GT-I9505 (4.4, xxhpdi) = 8 / 128 / 512MB
  • Google Galaxy Nexus (4.3) = 8 / 96 / 256MB
  • Google Nexus 4 (4.4, xhdpi) = 8 / 192 / 512MB
  • Google Nexus 5 (4.4, xxhdpi) = 8 / 192 / 512MB
  • 삼성 Galaxy S6 SM-G920W8 (7.0) = 8 / 256 / 512MB

태블릿 (Android 버전) :

  • 삼성 Galaxy Tab GT-P1000 (2.2) = 48MB
  • 삼성 Galaxy Tab 8.9 GT-P7300 (3.2) = 5 / 64 / 288MB
  • 삼성 Galaxy Tab 10.1 GT-P7500 (3.2) = 5 / 64 / 288MB
  • 삼성 Galaxy Tab 3 10.1 GT-P5200 (4.2, mdpi) = 8 / 96 / 256MB
  • Acer Iconia A500 (3.2.1) = 5 / 48 / 256MB
  • Kindle Fire HD 7 "(4.0.3) = 5 / 48 / 256MB
  • Asus Transformer Prime TF201 (4.1.1) = 5 / 48 / 256MB
  • Nexus 10 (4.4.3) 16 / 192 / 512MB

전화 생산자뿐만 아니라 Android OS 버전을 만드는 모든 사람은 장치의 특정 요구 사항에 따라 허용되는 최대 힙 크기를 지정할 수 있습니다. CyanogenMod와 같은 일부 Android 루트에서는 사용자가 설정으로 힙 크기를 직접 선택할 수도 있습니다.

방법을 사용하여 허용되는 최대 힙 크기를 감지 할 수 있습니다.

Runtime.getRuntime().maxMemory();

이 주제에 대한 추가 정보는 여기에서 확인할 수 있습니다 .

앱에 일반적으로 16MB 이상의 힙이 필요한 경우 권장되는 접근 방식은 매니페스트에 최소 OS 버전 수준을 설정하여 앱을 다운로드하는 사람들의 압도적 다수가 최소한 필요한 양을 가질 수 있도록하는 것입니다. 해당 체를 통과하는 최적의 힙 양보다 적은 소수의 사용자를 위해 필요에 따라 힙 요구 사항을 기본 수준 인 16MB까지 줄이는 방식으로 기능을 정상적으로 저하시키는 방법입니다.

다음은 전화 RAM과 OS 버전의 연관성을 보여주는 몇 가지 그림입니다 (원본이 아닌 현재 OS 기준). 적어도 1GB의 RAM을 가진 전화기는 거의 항상 16MB 이상의 힙을 가질 것이라고 생각합니다. 여기에서 백분율 은 표시된 메모리를 지원하는 전화 모델 수에 대한 것이며 사용중인 총 전화가 아니라 특정 모델에 대해 상당히 왜곡 될 수 있습니다. 이 번호는 입력을 다음 전화 찾기 (1500 개의 Android 전화 모델 포함)에 연결하여 얻은 것이며, 단지 야구장 수치입니다. http://www.gsmarena.com/search.php3

현재 OS 버전 (출시시 버전 아님) 별 RAM이 1GB 이상인 휴대 전화 모델의 비율 :

Phones running         Percent of models having at least 1GB of RAM   Percentage of all models
4.4 and up             100 percent                                    1.5
4.3 and up             100 percent                                    2.9
4.2.x and up           74 percent                                     18.7
4.1.x and up           71 percent                                     37
4.0 and up             62 percent                                     60
2.3.x and up           57 percent                                     71
2.2 and up             44 percent                                     93
2.1 and up             44 percent                                     97
ALL OS VERSIONS:       41.5 percent                                   100

다음을 사용하여 최대 VM 힙 크기를 확인할 수 있어야합니다.

getprop dalvik.vm.heapsize

at Android terminal (connectbot or adb shell etc). It is possible to remount read-write and set the heap size in the build.prop file as well. (Make sure you have recovery installed so you can re-set it if you accidentally make it too small, it won't boot up).


The "VM Budget" that an application is allowed to use varies from device to device. Tablets typically permit a larger budget than phones.

Here are some VM budget sizes I've found for various devices.

  • G1 = 16 Mb
  • Droid = 24 Mb
  • Nexus One = 32 Mb
  • Xoom = 48 Mb
  • GalaxyTab = 64 Mb.

(Note: if you've found differently, let me know)


There is actually a defined minimum application memory that depends on the screen size and density:

Mobile devices typically have constrained system resources. Android devices can have as little as 16MB of memory available to a single application. The Android Compatibility Definition Document (CDD), Section 3.7. Virtual Machine Compatibility gives the required minimum application memory for various screen sizes and densities. Applications should be optimized to perform under this minimum memory limit. However, keep in mind many devices are configured with higher limits.

Quoted from: http://developer.android.com/training/displaying-bitmaps/index.html

But as others have stated, each device manufacturer decide the actual value for the device, so it could be greater than this (but not smaller).

The mentioned Compatibility Definition Document (CDD) listing the minimum requirements for each version of android: https://source.android.com/compatibility/cdd.html

For the latest version of Android there is a html verison available, and we can directly link to the runtime memory section there: https://source.android.com/compatibility/android-cdd.html#3_7_runtime_compatibility

For Android 2.3:

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.

For the modern versions, there is instead a table where it depends on screen density etc:

For Android 4.2, example row from that table:

small / normal / large size and xhdpi density: 64MB

For Android 6, extract:

small/normal xhdpi: 80MB

small/normal xxhdpi: 128MB

small/normal xxxhdpi: 256MB

There is a table for the other Android 2.x, 4.x, 5.x and 6 versions too in those documents (see CDD link above).

Refer to this google link to easily find screen densities etc for specific devices: https://design.google.com/devices/


This data is working for me. Select Emulator Tablet Android TV RAM 1536MB VM HEAP 16MB Internal Storage 800MB Studio -managed 100

참고URL : https://stackoverflow.com/questions/5350465/android-heap-size-on-different-phones-devices-and-os-versions

반응형