Android的本机过程管理与绿化 -- performance 领域 和 processes 领域 和 greenify 领域 android 相关 的问题

Android's native process management vs. Greenify


简体版||繁體版
1
vote

问题

中文

免责声明:我不是以任何方式连接到绿化开发人员,也不是我试图促进绿化或任何东西。我真的对这些问题的答案感兴趣。

我发现,通过我管理的很多Android设备,它们会变得慢,在它们上安装更多的应用程序。这与在背景中执行某种任务的应用尤其如此。通常,设备可能会变得如此缓慢,以至于它们是真正的痛苦。

我发现的解决方案是一个名为 Greenify

  1. 是Android做类似的东西,因为当然是绿化的? (剥夺资源的背景应用程序以释放活动应用程序?)

  2. 如果是,如何绿化与Android的本机资源管理不同的绿色:

我发现很多人都有Android设备,往往会随着时间的推移而减速,而且他们中的许多人只需每隔几年购买一次新的更强大的设备。但是,如果他们使用绿化(或类似的东西),他们可能对许多年份的旧设备的性能感到满意。我例如,有一个五岁的手机,有很多应用程序,并且在使用绿化时的性能非常满意。但是,没有绿化(和所有的应用程序),手机很慢,它勉强可用。

  1. 是否有任何母语的Android方法,以防止在后台和播放系统资源中运行的应用程序?
例如,在GNU / Linux Distrs等Debian和Ubuntu中,应用程序根本不会运行或消耗任何资源,除非您显式启动它们(或让它们设置为启动时启动)与OS X和视窗。当您完全关闭程序时,它无法再使用任何资源。我认为即使iOS会在需要其他东西时会自动杀死背景应用程序。

我已经使用了手动任务杀手,但过了一会儿,我发现所有的应用程序都备份在后台在后台运行,即使我根本没有启动它们。

  1. 是真实的,Android在允许应用程序在后台运行,消耗资源时有点独特吗?
english

Disclaimer: I'm not in any way connected to the Greenify developers, nor am I trying to promote Greenify or anything. I'm actually interested in the answers to these questions.

I've found that with a lot of Android devices that I have managed, they become slower the more apps one installs on them. This is especially true with apps that perform some sort of tasks in the background. Often, devices can become so slow that they are a real pain to use.

The solution I found to this was an app called Greenify, that I use with root privileges and an Xposed module. I find that I can keep all the apps on the devices, but "Greenify" all of them. (I think this means that inactive apps are consistently "hibernated" or deprived of system resources, leaving the resources available for active apps.) This usually makes the device much snappier, yet I find that the impeding effect on the functionality of the apps is quite minimal. Needless to say, I consider Greenify a must, especially on devices with lots of resource hogging apps and/or limited hardware.

  1. Does Android do something similar to Greenify natively? (Depriving background apps of resources in order to free it up for active apps?)

  2. If yes, how is Greenify different from Android's native resource management?

I find that lots of people have Android devices that tend to slow down over time, and many of them end up just buying a new, more powerful device once every few years. But if they used Greenify (or something similar), they might have been satisfied with the performance of the older device for many, many more years. I for example, have a five year old phone, have tons of apps on it, and am quite happy with its performance when using Greenify. However, without Greenify (and with all my apps), the phone is so slow that it's barely usable.

  1. Is there any native Android way to prevent apps from running in the background and hogging system resources?

For example, in GNU/Linux distros like Debian and Ubuntu, apps don't run or consume any resources at all unless you explicitly launch them (or have them set to launch at startup.) It's the same with OS X and Windows. And when you shut a program completely down, it can no longer consume any resources. I think even iOS automatically kills background apps when it needs the resources for something else.

I've used manual task killers, but after a while, I find that all the apps are back up running in the background again, even if I haven't launched them at all.

  1. Is it true that Android is somewhat unique in allowing apps to run in the background, consuming resources?
        
         
         

回答列表

3
 
vote
vote
最佳答案
 
  1. Android实际上关闭了一些后台应用程序,但只有在缺少系统Ressources时(您打开大规模游戏)

  2. 绿化与Android内存管理的不同之处在于它杀死了您将在某个时间或经过一段时间后指定的所有应用程序,而不仅仅是在缺少Ressource时。

  3. nope。如果您未使用的某些系统应用程序在后台运行,则可以禁用它们或使用root应用程序或 adb shell

  4. 完全删除它们
  5. 这是我所知道的事情列表可以启动后台活动并保持打开:

    • 应用程序可以在系统启动时自动启动活动,并可在系统启动时自动启动。
    • 它也可以在打开时启动一个。
    • 在Android 4.3中的漏洞和之前允许应用程序保持活跃,即使Android任务杀手尝试杀死应用程序,但Greenify可以解决此问题(请参阅实验设置)。

和@deathmasksalesman,a htc wildfire s 运行Kitkat 需要绿化,否则它会令人难以置信地慢慢减少大量的电池,超过启动应用程序所需的东西。

 
  1. Android actually closes some background apps, but only when system ressources are missing (you open a massive game, for example)

  2. Greenify differ from the Android memory management by the fact that it kills all apps you specified at will or after a certain time, not only when ressources are missing.

  3. Nope. If some system apps that you do not use are running in background, you can disable them or remove them completely with a root app or the adb shell

  4. Here's the list of things that I know can start a background activity and keep it opened:

    • The apps can start an activity automatically at system startup with a permission.
    • It can also start one when opened.
    • A vulnerability in Android 4.3 and before allows app to keep them active, even when the Android task killer tries to kill apps, but Greenify can workaround this (see the experimental settings).

And @DeathMaskSalesman, a HTC Wildfire S running KitKat needs Greenify, or else it'll run incredibely slow and drain a lot of battery, more than what needed to start an app.

 
 
4
 
vote

从 Android开发人员网站:

  • 如果活动失去了焦点但仍然可见(即,新的非全尺寸或透明的活动侧重于您的活动顶部),它是暂停。暂停的活动完全活着(它维护所有状态和成员信息并保持附加到窗口管理器),但可以在极端低的内存情况下由系统杀死。
  • 如果活动完全被另一个活动掩盖,则它是停止。它仍然保留所有状态和成员信息,但是,用户不再可见,所以它的窗口是隐藏的,并且在其他地方需要内存时,系统通常会被系统杀死。
  • 如果活动暂停或停止,系统可以通过要求它完成或简单地捕获其进程来删除内存中的活动。当它再次显示给用户时,必须完全重新启动并恢复到其先前的状态。

所以,随着系统在内存上运行低,它可能会从最近使用的过程开始杀死流程[...],而且还要考虑哪些过程是大多数内存密集型的。

就技术实现而言,系统调用到应用程序,让他们知道他们需要释放内存或遭遇的风险:

此外,当您当前缓存的应用程序进程时,您可能会从intrimmemory()中的以下级别之一:
  • trim_memory_background

    系统在内存上运行低,您的进程靠近LRU列表的开头。虽然您的应用程序流程不受被杀死的高风险,但系统可能已经在LRU缓存中杀死进程。您应该释放易于恢复的资源,以便在用户返回应用程序时,您的进程将留在列表中并恢复。

  • trim_memory_moderate

    系统在内存上运行低,您的进程位于LRU列表的中间。如果系统进一步约束内存,则会有机会杀死您的过程。

  • trim_memory_complete

    系统在内存上运行较低,如果系统现在未恢复内存,您的进程是第一个被杀死的过程之一。您应该释放对恢复您的应用状态不重要的所有内容。

以便直接回答您的问题:

  1. no,Android不清除任何up for 应用程序,但它让他们知道自己这样做并杀死它们,如果他们没有(或者它不够)。< / p>

  2. greenify似乎可以"在线" 禁用应用程序,因此在后台时不允许运行任何内容(并且无法在运行时自动启动),但仍然可以在前景中的任何东西。这与Android如何在上面看,这与Android完全不同。

  3. 是 - 禁用它们(从设置→应用程序→&lt; app name&gt;)(尽管您想要手动运行时必须重新启用)。或者,对于那些没有自动重新启动服务的人,只需杀死它们(即,长按菜单按钮并将其滑落")。如果系统为它们提供意图等,后者将不会阻止它们重新启动。

  4. no,根本没有。真正的多任务服务长期以来一直在移动设备上提供 - 当没有这种能力的情况下,原始iPhone是一种奇怪的奇怪性。

 

From the Android developer site:

  • If an activity has lost focus but is still visible (that is, a new non-full-sized or transparent activity has focus on top of your activity), it is paused. A paused activity is completely alive (it maintains all state and member information and remains attached to the window manager), but can be killed by the system in extreme low memory situations.
  • If an activity is completely obscured by another activity, it is stopped. It still retains all state and member information, however, it is no longer visible to the user so its window is hidden and it will often be killed by the system when memory is needed elsewhere.
  • If an activity is paused or stopped, the system can drop the activity from memory by either asking it to finish, or simply killing its process. When it is displayed again to the user, it must be completely restarted and restored to its previous state.

Also:

So, as the system runs low on memory, it may kill processes [...] beginning with the process least recently used, but also giving some consideration toward which processes are most memory intensive.

As far as technical implementation goes, the system calls into apps to let them know that they need to release memory or risk being killed:

Also, when your app process is currently cached, you may receive one of the following levels from onTrimMemory():

  • TRIM_MEMORY_BACKGROUND

    The system is running low on memory and your process is near the beginning of the LRU list. Although your app process is not at a high risk of being killed, the system may already be killing processes in the LRU cache. You should release resources that are easy to recover so your process will remain in the list and resume quickly when the user returns to your app.

  • TRIM_MEMORY_MODERATE

    The system is running low on memory and your process is near the middle of the LRU list. If the system becomes further constrained for memory, there's a chance your process will be killed.

  • TRIM_MEMORY_COMPLETE

    The system is running low on memory and your process is one of the first to be killed if the system does not recover memory now. You should release everything that's not critical to resuming your app state.

So to directly answer your questions:

  1. No, Android does not clean anything up for apps, but it lets them know to do so themselves and kills them if they don't (or if it's not enough).

  2. Greenify appears to do "on-the-fly" disabling of apps, so it is not allowed to run anything when in the background (and can't be started automatically when not running), but can still do anything when in the foreground. This is completely different from how Android does it as you see above.

  3. Yes xe2x80x94 disable them (from Settings xe2x86x92 Applications xe2x86x92 <App Name>) (though you will have to re-enable when you want to run them manually). Or, for those that don't have automatically restarting services, simply kill them (i.e., long press the Menu button and swipe them away). The latter will not prevent them from restarting if the system delivers an Intent to them, etc.

  4. No, not at all. True multitasking has long been available on mobile devices xe2x80x94 the original iPhone was an oddity when it launched without that ability.

 
 
       
       

相关问题

2  绿化被封锁了  ( Greenify blocked ) 
我正在使用三星Galaxy S4 rooted设备。 我已经安装了绿化,但我在页面底部收到一个橙色错误框,说"自动休眠服务被第三方工具或系统设置阻止(索尼Devi Es的Egstamina模式。Miui的AutoStart Manager)白名单绿化用于自动休眠工作。" 在设置中,我制作了绿化设备管理员,但它没有解决...

0  LG Android中的“屏幕录制”[复制]  ( Screen recording in lg android ) 
这个问题已经在这里有一个答案: 如何禁用没有卸载的第三方应用程序? [重复] (1答) ...

3  从神秘的唤醒锁的电池排水  ( Battery drain from mysterious wake locks ) 
我在optroid 4.4.2上有一个巨大的电池漏极问题,obstroid 4.4.2股票rom cm11s o5q与francokernel r35。我凭借谷歌搜查了这么多次,但找不到任何东西,我现在真的很绝望。希望你们可以帮助我。 所以,前段时间,我注意到我的电池在"深睡眠" 中的夜晚耗尽2-8%,每小时真的不寻...

1  我可以使用类似功能运行应用程序吗?  ( Can i run apps with similar function ) 
最近我已经安装了果汁后卫和绿化。 在不知不觉中我跑了两个。结果非常伟大(电池几乎停止放电)。当我的屏幕关闭时,电池水平持续数小时。 在一起运行这两个应用程序是好的吗? ...

3  如何在技术上休眠应用程序?  ( How does hibernating an app work technically ) 
我想知道应用程序的休眠是多么休眠技术上。 我知道关于冻结app( shell pm disable com.mypackage.name ), 但这也隐藏了启动器的应用程序图标。我想知道如何 Greenify App 作品。它禁用该应用程序在后台运行,直到我再次启动它,然后在从该应用中退出时,绿化会自动休眠它。 ...

1  否“添加Google帐户”选项  ( No add google account option ) 
所以我有一个rooted s3迷你ve(i8200),带有库存自定义ROM(三星Apps和GAPP,但具有自定义主题)。我最近刚刚安装了它。我可以成功添加我的Google帐户。我正在玩绿化剪切(com.marvel.ppgadget wakewaththing),AP只是CTD。 NP,我重新启动它和未绿化的ppga...

1  Facebook被Google服务醒来,不想被绿化  ( Facebook woke up by google services and dont want to be greenified ) 
Facebook和IT Messenger应用程序正在分发我的Galaxy Note电池(植根)。当我绿化时,它们被Google服务激活。 如何在没有卸载的情况下停止激活? 非常感谢!! ...

1  如何停止应用程序唤醒其他应用程序?  ( How to stop apps from waking other apps ) 
我一直在我的Galaxy笔记2上运行4.1.1。我已经启用了Greenify以及具有PERMS阻止的Android调谐器。此外,我有一切都用Xprivacy争夺。我有面对休眠选择的人。每次我打开羽流,我注意到Facebook应用程序出来了休眠。我在"保持" 月前有同样的问题,但能够通过绿化削减目录路径。我不再看到这个...

1  如何处理IC中的呼叫的系统APK?  ( What is the system apk that handles the calls in ics ) 
我正在尝试弄清楚哪个系统APK处理Android IC中的呼叫?我发现消息传递是SMS的一个,但是拨打电话? 我要问的原因是因为我将它们添加到绿化。由于绿化有一个功能,只要有短信或呼叫,我希望它们在不使用时休眠,因为我不经常发短信或呼叫。 ...

-1  谷歌搜索和Chrome不在移动数据上工作  ( Google search and chrome not working on mobile data ) 
我有一个我正在运行的onlyplus 5.1.1氰化物操作系统。我扎根于它并安装绿化,并试图绿化Google应用程序。从那时起,我的Google Apps无法通过移动数据,而是在WiFi上工作。有人可以帮忙吗!?我已经彻底改造了,闪过了工厂形象,但仍然没有好处。 ...




© 2022 it.wenda123.org All Rights Reserved. 问答之家 版权所有