|
发表于 2020-8-28 11:48:52
6254 浏览 0 回复
MTK android 如何减少lowmemory的发生几率
[DESCRIPTION]
内存不足时常发生卡顿,甚至是死机重启问题,需要尽量减少内存不足情况的发生
[SOLUTION]
(1)减少后台进程的数量
修改frameworks\base\services\core\java\com\android\server\am\ProcessList.java
- static final int MAX_CACHED_APPS = 32; // 改为 static final int MAX_CACHED_APPS = 8;
复制代码 或者/frameworks/base/services/core/java/com/android/server/am/ActivityManagerConstants.java
- private static final int DEFAULT_MAX_CACHED_PROCESSES = 32;
复制代码
(2)调整Low Memory Killer minifree门限值,frameworks\base\services\core\java\com\android\server\am\ProcessList.java中,
调整下面的mOomMinFreeHigh里面的后三项 ,分别增大1.1倍、1.2倍、1.5倍。
- // These are the high-end OOM level limits. This is appropriate for a
- // 1280x800 or larger screen with around 1GB RAM. Values are in KB.
- private final int[] mOomMinFreeHigh = new int[] {
- 73728, 92160, 110592,
- 129024, 147456, 184320
- };
复制代码
|
|
手机微信同号:13682654092
|
|
|
|
|
登录或注册
|