简体   繁体   English

如何更改 Android 低 memory 杀手的“config.xml”值

[英]How to change Android "config.xml" values for low memory killer

I'm trying to tune these two low memory killer (lmk) values on my Pixel 4XL with Android 12:我正在尝试在我的 Pixel 4XL 上使用 Android 12 调整这两个低 memory 杀手 (lmk) 值:

<integer name="config_lowMemoryKillerMinFreeKbytesAbsolute">-1</integer>
<integer name="config_lowMemoryKillerMinFreeKbytesAdjust">0</integer>

According to this , "These thresholds can be configured with the config.xml framework."据此,“这些阈值可以使用 config.xml 框架进行配置。”

How can I change these values?我怎样才能改变这些值? Is there an equivalent "prop" I can set with setprop?我可以用 setprop 设置等效的“prop”吗?

Unfortunately there is no Android property for setting these thresholds.遗憾的是,没有用于设置这些阈值的 Android 属性。 They are seen as constants in the code and can be changed only within the config.xml它们在代码中被视为常量,只能在config.xml中更改

This is the documentation link where the semantics of these constants is described.这是描述这些常量语义的文档链接

Furthermore it is worth noting that the mentioned constants are relevant only for the LMKD legacy mode , eg in case of property ro.lmk.use_minfree_levels being set to true .此外值得注意的是,提到的常量仅与LMKD 遗留模式相关,例如在属性ro.lmk.use_minfree_levels被设置为true的情况下。

Exploring the LMKD documentation you may find that there are at least 2 alternatives out there:浏览LMKD 文档,您可能会发现至少有 2 个备选方案:

  1. using vmpressure signals使用 vmpressure 信号
  2. using PSI (pressure stall information) monitors使用 PSI(压力失速信息)监视器

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

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