cts-verify中BYOD Managed Provisioning ,涉及到low_memorykiller问题

CTS Verifier 中执行 BYOD Managed Provisioning测试项时
camera support cross profile video capture测试项,返回后之前所有的测试结果消失。

跟踪log发现有low_memorykiller的相关信息:
 
    
I/KERNEL ( 88): [ 276.370260] lowmemorykiller: Killing 'id.cts.verifier' (5440), adj 529,
I/KERNEL ( 88): [ 276.370260] to free 50908kB on behalf of 'kswapd0' (88) because
I/KERNEL ( 88): [ 276.370260] cache 223476kB is below limit 225000kB for oom_score_adj 529
I/KERNEL ( 88): [ 276.370260] Free memory is 41032kB above reserved
D/Sensors ( 695): setDelay is 100000000
出现这个问题的主要原因是,打开camera的应用后吃的内存太多,内存值达到了low_memorykiller的最低阀值,因此该机制杀掉了正在后台的cts-verify应用。

rootcause是修改了阀值导致。
framework:  /framework/base/services/core/java/com/android/server/am/ProcessList.java
该类中有两个数组:
 
    
// These are the low-end OOM level limits. This is appropriate for an
// HVGA or smaller phone with less than 512MB. Values are in KB.
private final int[] mOomMinFreeLow = new int[] {
12288, 18432, 24576,
36864, 43008, 49152
};
// 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
};
mOomMinFreeLow,mOomMinFreeHigh 

由于目前我对该机制不是特别了解,需要进一步学习下。google一下发现很多大牛都有相关博客总结,得先去学习下。
涉及到的知识点:low_memorykiller机制

你可能感兴趣的:(Android开发主线)