• Home
  • History
  • Annotate
Name Date Size #Lines LOC

..--

include/22-Nov-2023-20384

tests/22-Nov-2023-415311

Android.bpD22-Nov-2023903 5147

OWNERSD22-Nov-202318 21

README.mdD22-Nov-20232.6 KiB6645

liblmkd_utils.cD22-Nov-20232.1 KiB7749

lmkd.cD22-Nov-202343.7 KiB1,5731,226

lmkd.rcD22-Nov-2023176 76

statslog.cD22-Nov-20233.1 KiB11873

statslog.hD22-Nov-20232.6 KiB9244

README.md

1Android Low Memory Killer Daemon
2================================
3
4
5Introduction
6------------
7
8Android Low Memory Killer Daemon (lmkd) is a process monitoring memory
9state of a running Android system and reacting to high memory pressure
10by killing the least essential process(es) to keep system performing
11at acceptable levels.
12
13
14Background
15----------
16
17Historically on Android systems memory monitoring and killing of
18non-essential processes was handled by a kernel lowmemorykiller driver.
19Since Linux Kernel 4.12 the lowmemorykiller driver has been removed and
20instead userspace lmkd daemon performs these tasks.
21
22
23Android Properties
24------------------
25
26lmkd can be configured on a particular system using the following Android
27properties:
28
29  ro.config.low_ram:         choose between low-memory vs high-performance
30                             device. Default = false.
31
32  ro.lmk.use_minfree_levels: use free memory and file cache thresholds for
33                             making decisions when to kill. This mode works
34                             the same way kernel lowmemorykiller driver used
35                             to work. Default = false
36
37  ro.lmk.low:                min oom_adj score for processes eligible to be
38                             killed at low vmpressure level. Default = 1001
39                             (disabled)
40
41  ro.lmk.medium:             min oom_adj score for processes eligible to be
42                             killed at medium vmpressure level. Default = 800
43                             (non-essential processes)
44
45  ro.lmk.critical:           min oom_adj score for processes eligible to be
46                             killed at critical vmpressure level. Default = 0
47                             (all processes)
48
49  ro.lmk.critical_upgrade:   enables upgrade to critical level. Default = false
50
51  ro.lmk.upgrade_pressure:   max mem_pressure at which level will be upgraded
52                             because system is swapping too much. Default = 100
53                             (disabled)
54
55  ro.lmk.downgrade_pressure: min mem_pressure at which vmpressure event will
56                             be ignored because enough free memory is still
57                             available. Default = 100 (disabled)
58
59  ro.lmk.kill_heaviest_task: kill heaviest eligible task (best decision) vs.
60                             any eligible task (fast decision). Default = false
61
62  ro.lmk.kill_timeout_ms:    duration in ms after a kill when no additional
63                             kill will be done, Default = 0 (disabled)
64
65  ro.lmk.debug:              enable lmkd debug logs, Default = false
66