ios Jetsam 究竟是做什么的?

声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow 原文地址: http://stackoverflow.com/questions/15122986/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me): StackOverFlow

提示:将鼠标放在中文语句上可以显示对应的英文。显示中英文
时间:2020-08-30 22:29:05  来源:igfitidea点击:

What does Jetsam really do?

iosperformance

提问by Jim

In a question I askedseveral months ago, I asked if the effect of Jetsam on memory usage can be observed. I answered my own question using instruments, finding that apps killed by Jetsam still had the same memory footprint that they had before they were terminated.

在几个月前我问的一个问题中,我问是否可以观察到 Jetsam 对内存使用的影响。我使用工具回答了我自己的问题,发现被 Jetsam 杀死的应用程序仍然具有与终止之前相同的内存占用量。

Even today, I still see jettisoned apps in the running task barrecently-used app list. I don't get any performance improvement unless I remove them myself, even after Jetsam has killed them.

即使在今天,我仍然在运行任务栏最近使用的应用程序列表中看到丢弃的应用程序。除非我自己删除它们,否则我不会获得任何性能改进,即使在 Jetsam 杀死它们之后也是如此。

If that's the case, what is the purpose of Jetsam and what is it doing (other than killing apps)? I don't see any benefits. Is this a bug?

如果是这样,Jetsam 的目的是什么,它在做什么(除了杀死应用程序)?我看不出有什么好处。这是一个错误吗?

回答by Lily Ballard

Even today, I still see jettisoned apps in the running task bar. I don't get any performance improvement unless I remove them myself, even after Jetsam has killed them.

即使在今天,我仍然在运行的任务栏中看到被抛弃的应用程序。除非我自己删除它们,否则我不会获得任何性能改进,即使在 Jetsam 杀死它们之后也是如此。

Poppycock. There's no such thing as a "running task bar". You're thinking of the list of recently-used apps. The presence of an app in this bar does not indicate that the app is still running, and removing killed apps from this bar has no effect on performance/memory. The only thing removing an app does from this bar that is beneficial is it kills the app if it was still running.

胡说。没有“正在运行的任务栏”这样的东西。您正在考虑最近使用的应用程序列表。此栏中的应用程序的存在并不表示该应用程序仍在运行,并且从此栏中删除已终止的应用程序对性能/内存没有影响。从此栏中删除应用程序所做的唯一有益的事情是,如果该应用程序仍在运行,它将杀死该应用程序。

As for jetsammed apps, it's not surprising that the app will have the same memory footprint after it's relaunched. Apps are typically jetsammed because they're suspended and the foreground app needs more memory. The fact that an app is jetsammed does not indicate that the app was necessarily using an unacceptable amount of memory.

至于 jetsammed 应用程序,应用程序在重新启动后将具有相同的内存占用并不奇怪。应用程序通常会被喷射,因为它们被挂起并且前台应用程序需要更多内存。应用程序被喷射的事实并不表示应用程序必然使用了不可接受的内存量。

回答by user3689657

As it turns out, When a program leaves the forground it goes into a "suspended" state. The OS will then keep the memory around for that application as long as the OS doesn't need it for something else so the program loads faster.

事实证明,当程序离开前台时,它会进入“暂停”状态。只要操作系统不需要它用于其他用途,操作系统就会为该应用程序保留内存,以便程序加载速度更快。

Jettison works the same way: it FREES UP memory...which is different than CLEARING memory.

Jettison 的工作方式相同:它释放内存......这与清除内存不同。

The important difference being that the memory stays intact when it gets jettisoned until the OS needs to use it for something else. Clearing is the same...except you are erasing the contents in addition to freeing the memory up.

重要的区别在于内存在被抛弃时保持完整,直到操作系统需要将其用于其他用途。清除是一样的......除了你除了释放内存之外还要擦除内容。