简体   繁体   English

在Android上,最多可以在内存中缓存多少个应用程序?

[英]On Android, how many apps can be cached in memory at most?

When a user opens a different app, the previous app would be cached in the memory, except the user kills it explicitly, or the memory gets too low. 当用户打开其他应用程序时,以前的应用程序将被缓存在内存中,除非用户明确杀死它,否则内存会变得太低。 As the user continues using different apps, more and more apps may be cached in the memory based on the LRU policy. 随着用户继续使用不同的应用程序,基于LRU策略,越来越多的应用程序可能会缓存在内存中。

The number of cached apps may depends on what apps would be cached and what is the total available memory, as different apps consume different amounts of memory. 缓存的应用程序的数量可能取决于要缓存的应用程序以及总的可用内存,因为不同的应用程序消耗不同的内存量。

Let's assume the total available memory is always sufficient, then how many apps can be cached in the memory at most? 假设总可用内存总是足够的,那么最多可以在内存中缓存多少个应用程序? Is this number fixed across different Android versions? 这个数字在不同的Android版本中固定吗? Does it depends on the devices' parameters? 是否取决于设备的参数?

On my nexus 7 with Android 4.2, it seems this number is 10. Correct me if you find it wrong. 在具有Android 4.2的nexus 7上,该数字似乎是10。如果发现错误,请纠正我。

As far as I know, there is no number of apps limit. 据我所知,没有任何应用程序限制。 The limit is dynamic based on available memory on the device as well as actual memory used by each open app. 该限制是动态的,取决于设备上的可用内存以及每个打开的应用程序使用的实际内存。 For example, if you have an app that uses a few large bitmaps, and then open the gmail app, your app will be killed. 例如,如果您有一个使用一些大位图的应用程序,然后打开gmail应用程序,则该应用程序将被杀死。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM