首页 技术 正文
技术 2022年11月7日
0 收藏 729 点赞 410 浏览 3020 个字

这是在国外一家网站看到的,分析得不错,原文如下:

Why does the iPhone require less RAM than Android devices?

There are people who always fight when it comes to comparing the Android devices vs iPhone. Iphones are way more expensive than Android devices even with the same specifications. However, the iPhone works a lot smoother and faster than an Android device with the same amount of RAM. That means an iPhone with 2GB RAM works much faster than an Android device with 2GB RAM with same features.

If you compare the performance of iPhone 7 (2GB RAM) with Google Pixel  (4GB RAM) or Samsung s7 (4GB RAM), You’ll see no difference in performance. iPhone 6 was the best performing phone in its time with just 1 GB of RAM. Now, the question is why does the iPhone require less RAM than Android devices? Why does the Android device need more RAM?

Why does the iPhone require less RAM than Android devices?

It involves many factors. Basically the Garbage collection, App Management, User Interface, and Hardware.

 

1. Garbage collection

In the case of Android, since it involves garbage collection it requires more memory. The Android apps use Java and as a result, Android does garbage collection. The problem with garbage collection is that memory usage grows until it’s collected, so there might be more memory allocated than necessary. That’s bad for devices with restricted memory and no option to swap.

When the garbage collector runs, it scans the heap to find memory that’s no longer being used, and that’s an expensive process, that slows down the device until is has completed.

The iPhone do not use Garbage Collection. It uses Automatic Reference Counting, which is an innovative way of managing Objective-C objects on iOS. It does away with explicit retain, release and autorelease messages, and it behaves the same on both platforms.  Unlike garbage collection, ARC does not handle reference cycles automatically. This means that as long as there are “strong” references to an object, it will not be deallocated. Strong cross-references can accordingly create deadlocks and memory leaks. It is up to the developer to break cycles by using weak references.

Read: Premium Ethical Hacking and Programming courses online 

Here is the full Difference between ARC vs Garbage Collection

2. User Interface

An Android user often complains about phone lag but the iOS UI runs so smooth. The main reason is that the iOS UI rendering happens in a separate thread with real-time priority but on Android, this happens in the main thread with normal priority. This means that other apps in Android can take over the processor resources and hurt basic UI interactions, translating into a noticeable lag.

3. App management

Android lets developers run processes in the background more freely than iOS. iOS kills any process when it thinks it doesn’t need to be running. Apps that play music in the background or similar can stay alive.

Android gives a lot of freedom to app developers that cause memory leaks or resource hogging background processes which means you need to be careful what you install on your Android device. Android has made some attemps to control this, such as killing apps that use too much CPU, but still, these problems can be noticed by the user.

The iOS puts a lot of limitations on the developers and what they can do causes them not to do much harm.

4. Hardware

Apple’s iOS is optimized to run on the hardware, which is also designed and tested by Apple, and manufactured by Apple’s manufacturing partners. Android doesn’t have that level of control because the software OS developers are separate from the hardware makers

相关推荐
python开发_常用的python模块及安装方法
adodb:我们领导推荐的数据库连接组件bsddb3:BerkeleyDB的连接组件Cheetah-1.0:我比较喜欢这个版本的cheeta…
日期:2022-11-24 点赞:878 阅读:8,942
Educational Codeforces Round 11 C. Hard Process 二分
C. Hard Process题目连接:http://www.codeforces.com/contest/660/problem/CDes…
日期:2022-11-24 点赞:807 阅读:5,468
下载Ubuntn 17.04 内核源代码
zengkefu@server1:/usr/src$ uname -aLinux server1 4.10.0-19-generic #21…
日期:2022-11-24 点赞:569 阅读:6,281
可用Active Desktop Calendar V7.86 注册码序列号
可用Active Desktop Calendar V7.86 注册码序列号Name: www.greendown.cn Code: &nb…
日期:2022-11-24 点赞:733 阅读:6,095
Android调用系统相机、自定义相机、处理大图片
Android调用系统相机和自定义相机实例本博文主要是介绍了android上使用相机进行拍照并显示的两种方式,并且由于涉及到要把拍到的照片显…
日期:2022-11-24 点赞:512 阅读:7,728
Struts的使用
一、Struts2的获取  Struts的官方网站为:http://struts.apache.org/  下载完Struts2的jar包,…
日期:2022-11-24 点赞:671 阅读:4,765