When it comes to talk about smartphone operating systems, Android and iOS will always stand ahead of any other OS. The debate and comparison between Android and iOS is also not a new topic. Users of both the OS will put their own points in favor of their personal choice. The Android operating system may not have some features of iOS and vice-versa. Yet, it is not necessary to draw the conclusion that one OS is better than the other. Even then we cannot claim that the debates as well as comparisons of the two OS will not disappear overnight.
While comparing the two OS, you may have come across questions like “Which OS is much secure?” or” Why iOS apps are better that Android apps”. These questions are no doubt valid ones; however, Devs Journal have come up with a different issue that comes into consideration while comparing the two OS. It is about the RAM size of the two OS. If you have ever gone through the specifications of an iPhone and an android phone within the same price range, you will notice that the iPhone running in the iOS operating system is having almost half of the RAM that the android phone is having. Why is this?
We will be discussing about this topic in this article, but before that let’s have a quick look at few basic things.
WHAT IS RAM?
You have to be sure here that we are talking about the phone’s RAM not the internal memory. The internal memory of the phone is often dubbed with the RAM of the phone when specifications are mentioned.
RAM stands for random access memory. The data stored in RAM can be accessed instantly. The phone doesn’t require to scan sequentially like in case of data stored in CD drive, tape cassette or even in a hard drive.
RAM is used to store the data of the apps that the phone is currently using or running.
MULTITASKING AND RAM:
Most smartphones nowadays have the ability to perform multitasking where two or more apps are running simultaneously on-screen at once. Multitasking involves the use of more RAM and hence smartphones with multitasking facility are shipped with a higher RAM than the ones which doesn’t support multitasking. For e.g. the iPad mini 4 which has a 2GB RAM can perform real time multitasking whereas the iPad mini 3 with 1GB RAM cannot.
Thus, you might have got a fair idea that the RAM size is responsible in enhancing the overall performance of the smartphone.
ANDROID AND JAVA GARBAGE COLLECTION:
The Android Operating System is developed using the JAVA programming language and hence JAVA is the official language of Android. Though other languages like C and C++ can also be used to develop android apps, Google doesn’t promote that practice. And hence, so far JAVA is used by developers across the world for apps development.
What is garbage collection mechanism?
Studies say that the garbage collection mechanism of JAVA is primarily responsible for the high RAM requirement of Android devices. But what is garbage collection? In JAVA, garbage means unreferenced objects. Garbage collections is a process of reclaiming the unused memory automatically. In other word it is a way to destroy the unused object. The garbage collector of JAVA removes the unreferenced objects from the heap memory. The problem with garbage collection is that memory usage grows until it’s collected.
The iOS doesn’t use garbage collection. It uses an innovative mechanism of managing objective C objects.
BACKGROUND AND FOREGROUND
In case of android, if multiple apps are running simultaneously, then the active and most prior apps are run at the foreground, while the less prior apps are kept alive and they run in the background. Android keeps all apps alive if there are sufficient RAM to support it. Empty RAM are considered wasted RAM in android. And hence if there are sufficient RAM, the android keeps the apps running in the background. If the RAM is exhausted, the system kills of the lesser use processes or apps.
However, contrary to that iOS has a better memory management mechanism. The technique used by iOS for managing memory is based on the following three factors:
- Apps that start a short task in the foreground can ask for time to finish that task when the app moves to the background.
- Apps that initiate downloads in the foreground can hand off management of those downloads to the system, thereby allowing the app to be suspended or terminated while the download continues.
- Apps that need to run in the background to support specific types of tasks can declare their support for one or more background execution modes.
iOS always maintain the fact that it avoids doing any background work unless doing so improves the overall user experience.
UI of the android is also a reason why it requires more RAM for better performance. While on iOS UI rendering happens in a separate thread with real-time priority, on Android this happens in the main thread with normal priority. This causes lag in the Android UI interactions.
That concludes this discussion and comparison about the RAM of Android and iOS operating systems.