• Home
Name Date Size #Lines LOC

..--

include/03-May-2024-249108

libpsi/03-May-2024-194107

tests/03-May-2024-417312

Android.bpD03-May-2024980 5450

OWNERSD03-May-202418 21

README.mdD03-May-20242.6 KiB6645

event.logtagsD03-May-20241.5 KiB3937

liblmkd_utils.cD03-May-20242.1 KiB7749

lmkd.cD03-May-202459.3 KiB2,1001,601

lmkd.rcD03-May-2024263 98

statslog.cD03-May-20243.4 KiB12780

statslog.hD03-May-20242.8 KiB9749

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