Why does the iPhone need so much less RAM than Android devices?When comparing an iPhone to other Android powered flagship phones, one thing that tends to stand out, is the significant difference in the RAM storage of the devices. As a result, most people conclude that iPhone needs less RAM or that Android apps hog storage space. But does Android really use more RAM than iOS ?
The first thing we need to establish here, is that we are not talking about storage space. Internal storage space of devices is many a times clubbed together with RAM storage when the specifications are listed. What we are talking about is Random Access Memory (RAM), the memory used by the CPU to hold and execute apps. Below is a comparison between the flagship devices of companies over the past few years.
|2016||iPhone 7: 2GB|
iPhone 7 Plus: 3GB
|S7 & S7 Edge: 4GB||G5: 4GB|
|Pixel & Pixel XL: 4GB|
|2015||iPhone 6S: 2GB|
iPhone 6S Plus: 2GB
|S6 & S6 Edge: 3GB|
S6 Edge+: 4GB
|Nexus 5X: 2GB|
Nexus 6P: 3GB
|2014||iPhone 6: 1GB|
iPhone 6 Plus: 1GB
|S5: 2GB||G3: 2GB (16 GB model)|
G3: 3GB (32 GB model)
|Nexus 6: 3GB|
|2013||iPhone 5S: 1GB||S4: 2GB||G2: 2GB||Nexus 5: 2GB|
As you can see, iPhone consistently have lower RAM storage than Android devices with the only exception being the Nexus 5X. The popular opinion regarding this, is that iOS can offer the same if not better user experience by using lesser amount of RAM and this is inherently caused due to Android use of Java’s Garbage Collection Mechanism. This view will be reflected as the most popular opinion on the internet. But the more deeper you look into the problem, the more this opinion starts sounding like a myth.
Resident Set Size
This physical memory used by the app is termed as the Resident Set Size or RSS and is the best indicator of how much physical memory an app will need to run. Researchers have used a number of tools to identify the RSS needed for various apps on both iOS and Android. To test the claim, the same number of apps were installed on an iOS and an Android device and their RSS was determined. In each case the app was actually being used. Below are the results:
As you can see, it is a bit of a mixed bag. The Crossy Road app on Android uses 383MB of memory, while on iOS it uses 308MB. But conversely Temple Run 2 uses 211MB on Android and 364MB on iOS. Overall the trend is that Android apps use slightly more memory, around 6% more than iOS apps. However iOS apps aren’t half the size of Android apps. Its fair to say therefore, that the claim of Android apps being a memory hog doesn’t hold water. The actual reason cause therefore, is something else entirely.
The difference in the storage needs stems from the way the two OSes control background processes. Each of them follows a different approach and hence produce different results. iOS handles moving of an app into the background in 3 different ways:
- An app can request time to complete a task that had begun when it was in the foreground before being pushed into the background.
- Apps that have begun a download process, can pass on these process to the system and therefore can be suspended or terminated while the download progresses unabated.
- Apps that need to run in the background to support a specific task can declare their support for one or more background execution modes.
Android keeps all apps alive on the RAM if there is sufficient RAM to support it. For Android, empty RAM is wasted RAM. This reduces battery usage as the apps are only initialized once and then remain alive on the RAM. Unless these apps have a background process, they do not use any battery while being kept alive. If your device runs out of RAM, then the system will kill off lesser used processes to allow its users to run the apps without worrying.
This difference in approach makes a lot of difference. The restrictions that iOS puts on its apps ensures better RAM management while at the same time keeping the user interface chugging along without any noticeable lag. Android on the other hand allows its apps to enjoy a higher degree of freedom thus allowing them to keep working in the background even though its not being used and this lets a user to get back to an app in its running state with any running tasks unhindered.
On the flip side of this approach, while iOS users might find their apps being in a frozen state when they get back to it, they get to enjoy having their device never suffering from a visible lag whereas Android substitutes this by allowing more processing to be done and thus has a higher requirement of RAM.