Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Android heap size on different phones/devices and OS versions

Does anyone know if the heap size on Android phones is a constant value according to what is set in the OS version or if this is a setting which the phone producers can decide on?

Is the heap size proportional to the amount of RAM on the phone?

I've only found articles where people say that the heap size of an application is 16M. However, these articles are a bit old. From what I see, as an example, heap sizes vary from around 20M up to 24M on one specific model. This phone has 768M of RAM.

like image 379
Eric Nordvik Avatar asked Mar 18 '11 10:03

Eric Nordvik


People also ask

What is Android heap size?

Most devices running Android 2.3 or later will return this size as 24MB or higher but is limited to 36 MB (depending on the specific device configuration). If your app hits this heap limit and tries to allocate more memory, it will receive an OutOfMemoryError and will terminate. Heap memory is used to allocate objects.

What is the size of heap?

The default heap size is 1 MB. The linker rounds up the specified value to the nearest 4 bytes. The optional commit argument specifies the amount of physical memory to allocate at a time. Committed virtual memory causes space to be reserved in the paging file.

What is XMX setting in Android Studio?

Xmx specifies the maximum memory allocation pool for a Java Virtual Machine (JVM), while Xms specifies the initial memory allocation pool. Your JVM will be started with Xms amount of memory and will be able to use a maximum of Xmx amount of memory. Save the studio. vmoptions file and restart Android Studio.


1 Answers

Some more device info extracted from build.prop files (adb -d pull /system/build.prop):

Phones (Android Version):

  • 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
  • Samsung Galaxy S GT-I9000 (2.2) = 48MB
  • Samsung Galaxy R GT-I9103 (2.3.5) = 64MB
  • Samsung Galaxy Y GT-S5360 (2.3.5) = 64MB
  • Samsung Galaxy Note N7000 (4.1.2) = heapstartsize=8m, heapgrowthlimit=64m, heapsize=256m
  • Samsung Galaxy S3 GT-I9300 (4.3, xhpdi) = 8/64/256MB
  • Samsung 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
  • Samsung Galaxy S6 SM-G920W8 (7.0) = 8/256/512MB

Tablets (Android Version):

  • Samsung Galaxy Tab GT-P1000 (2.2) = 48MB
  • Samsung Galaxy Tab 8.9 GT-P7300 (3.2) = 5/64/288MB
  • Samsung Galaxy Tab 10.1 GT-P7500 (3.2) = 5/64/288MB
  • Samsung 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/512 MB
like image 113
spatialist Avatar answered Nov 08 '22 10:11

spatialist