gpt4 book ai didi

android - 为什么 Android 和 iOS 不在应用关闭时杀死进程?

转载 作者:行者123 更新时间:2023-11-29 16:30:52 25 4
gpt4 key购买 nike

在 Windows、MacOS 和 Linux 上,当应用程序关闭时,通常它的进程也会被终止。这在 Windows/Linux 上默认发生,在 MacOS 上,当没有应用程序窗口打开时,按 CMD+Q 终止进程似乎仍然是个好主意。

在 Android(和 iOS)上,当应用程序处于后台时,它的进程仍然存在于内存中,直到操作系统发现有必要将其推出。该进程可以终止,但此步骤不是默认的操作系统行为,用户体验在某种程度上不鼓励这样做。

为什么?


更新

一些回复似乎确实表明将应用程序保存在内存中有潜在的好处。因此,进一步的跟进将是,为什么主流桌面操作系统不遵循相同的方法来获得所有相同的好处?

最佳答案

Android is very good at managing its resources. It has a certain amount of memory (RAM) to work with, and it’ll happily allow apps to use as much as they need for best performance.

If RAM starts to get a bit short, and other apps and tasks need some, then the OS will quietly close one of the apps running in the background that you haven’t used for a while, and assign that app’s RAM to the new task.

As a result, apps can stay in memory for hours, days or potentially even weeks since you last used them. And this is fine. They’re not draining the battery or using other resources so there’s no downside; the upside is they will load much quicker when you need them, and load them right back to the place where you left off too.

(It’s also worth noting at this point that there’s really no benefit in keeping RAM free. RAM exists to be used, and using all of it at any given time—or virtually all of it at least—will ensure your phone or tablet runs smoother than if you try and keep some RAM free.)

With all this in mind, it becomes clear why closing apps can have a worse effect on Android than leaving them open.

引用:androidtipsandhacks.com

关于android - 为什么 Android 和 iOS 不在应用关闭时杀死进程?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/55701756/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com