Why do Android phones need more RAM than iPhones?

Powerful phones android They have high RAM and viewing capacities 12 GB On products like Pixel 6 Pro And Galaxy S22 Ultra Not so unexpected. On the other hand, phones Apple Usually from RAMs 6 Or 4 GB However, we still have the same or better performance than Androids with high RAM, but what is the reason for this?
What is RAM?
RAM (RAM) Abbreviation of the phrase random-access memory Or random access memory is and includes several types, but the RAM used in smartphones is of the type SDRAM Is. Unlike non-volatile storage that stores information long-term, RAMs only retain information as long as the device is powered.
In other words, Rome can be a form of “working memoryHe considered it for the device. When you open multiple apps or content within an app, your phone allocates a portion of available RAM to each of these new processes.
This process will continue until there is no RAM left to use and the phone is forced to end one of the processing items so that the device’s performance does not suffer. Naturally, the higher the RAM, the less this problem occurs.
Why do Android phones need more RAM?
Now that we know what RAM is and how it works, we can return to our initial question, but to answer it, it must be said that the mentioned matter does not have an explicit or definite reason, but several factors are involved in it.
The first factor is that the method of building Android and iOS applications is different. One of the reasons for the aforementioned difference is that not many new iPhones and iPads are introduced to the market every year, and these few models often use similar hardware.
This homogeneity and similarity between chips and hardware allows developers to create their apps using Apple’s programming language (swift And Objective-C) to be integrated with hardware in a special way. Also, the codes written for iOS apps are directly compiled in the form of commands that the processor of Apple products does not need any translation to understand them.
On the other hand, practically unlimited devices are released every year with the Android operating system, the chips of each of which may be modified by Qualcomm, Samsung Or Mediatek have been made, thus making all apps compatible with all types of hardware is considered impossible.

Also Android apps from programming language Kathleen And Java They use that before being understood by the processor 2 times in interface coding language (bytecode) and then translated into the native language of the chip.
The differences mentioned in the coding of the 2 operating systems will eventually lead to the fact that Android devices need more memory resources to run programs.
The second factor is that the way RAM is managed in each of these operating systems is also different. Android for memory management methodGarbage collection” and during this process it periodically finds and deletes the items in the memory that are no longer used to free up more RAM space.
On the opposite side of iOS from the “Automatic reference counting(ARC) benefits. This method automatically creates a numerical value for each item in RAM based on the number of other items related to them, and then the items whose numerical value is Zero Removes it from the processing cycle.

By comparing these two methods, we can see that since the garbage collection method works only periodically, it can cause the accumulation of useless information in the RAM and slow down the device; A problem that is not present in the ARC method because redundant information is removed as soon as it is detected.
The third factor is also related to the fact that Android is not as strict in the area of processing apps in the background as iOS. For this reason, Android apps may remain floating in RAM even if they are not used. In other words, the flexibility of Android, which is one of the strengths of this platform, can be considered as the Achilles heel of this operating system.
In the end, according to all the explanations given, it can be said that Android and iOS have different RAMs because they work differently. Android is obviously more flexible, but this flexibility can come at the cost of higher RAM requirements.