summaryrefslogtreecommitdiffstats
path: root/rootdir
diff options
context:
space:
mode:
authorDianne Hackborn <hackbod@google.com>2011-08-08 14:55:14 -0700
committerAndroid (Google) Code Review <android-gerrit@google.com>2011-08-08 14:55:14 -0700
commitd09196d00cb5bf3bffb22d3aae45c8797f1ddf4c (patch)
treef0431c6e220efd45e6fa9e7442117b4957ebcfcf /rootdir
parenta24687197d69ac677d176dbc41d5cfd65d1afc44 (diff)
parent06787f4089093fed8a01ec3a3d2092e10919b77e (diff)
downloadsystem_core-d09196d00cb5bf3bffb22d3aae45c8797f1ddf4c.zip
system_core-d09196d00cb5bf3bffb22d3aae45c8797f1ddf4c.tar.gz
system_core-d09196d00cb5bf3bffb22d3aae45c8797f1ddf4c.tar.bz2
Merge "Activity Manager now takes care of setting OOM values."
Diffstat (limited to 'rootdir')
-rw-r--r--rootdir/init.lowmem.rc19
-rw-r--r--rootdir/init.rc53
2 files changed, 8 insertions, 64 deletions
diff --git a/rootdir/init.lowmem.rc b/rootdir/init.lowmem.rc
deleted file mode 100644
index 7c08054..0000000
--- a/rootdir/init.lowmem.rc
+++ /dev/null
@@ -1,19 +0,0 @@
-# Adjustments to the out-of-memory killer, for devices that are
-# tight on memory. These should not be used if not needed, as they
-# can result in more paging.
-
-on early-boot
-
- setprop ro.FOREGROUND_APP_MEM 1536
- setprop ro.VISIBLE_APP_MEM 2048
- setprop ro.PERCEPTIBLE_APP_MEM 2048
- setprop ro.HEAVY_WEIGHT_APP_MEM 2048
- setprop ro.SECONDARY_SERVER_MEM 4096
- setprop ro.BACKUP_APP_MEM 4096
- setprop ro.HOME_APP_MEM 4096
- setprop ro.HIDDEN_APP_MEM 5120
- setprop ro.EMPTY_APP_MEM 6144
-
-on boot
-
- write /sys/module/lowmemorykiller/parameters/minfree 1536,2048,3072,4096,5120,6144
diff --git a/rootdir/init.rc b/rootdir/init.rc
index 4d446c8..e2832d8 100644
--- a/rootdir/init.rc
+++ b/rootdir/init.rc
@@ -190,54 +190,17 @@ on boot
# set RLIMIT_NICE to allow priorities from 19 to -20
setrlimit 13 40 40
-# Define the oom_adj values for the classes of processes that can be
-# killed by the kernel. These are used in ActivityManagerService.
- setprop ro.FOREGROUND_APP_ADJ 0
- setprop ro.VISIBLE_APP_ADJ 1
- setprop ro.PERCEPTIBLE_APP_ADJ 2
- setprop ro.HEAVY_WEIGHT_APP_ADJ 3
- setprop ro.SECONDARY_SERVER_ADJ 4
- setprop ro.BACKUP_APP_ADJ 5
- setprop ro.HOME_APP_ADJ 6
- setprop ro.HIDDEN_APP_MIN_ADJ 7
- setprop ro.EMPTY_APP_ADJ 15
-
-# Define the memory thresholds at which the above process classes will
-# be killed. These numbers are in pages (4k).
- # These are currently tuned for tablets with approx 1GB RAM.
- setprop ro.FOREGROUND_APP_MEM 8192
- setprop ro.VISIBLE_APP_MEM 10240
- setprop ro.PERCEPTIBLE_APP_MEM 12288
- setprop ro.HEAVY_WEIGHT_APP_MEM 12288
- setprop ro.SECONDARY_SERVER_MEM 14336
- setprop ro.BACKUP_APP_MEM 14336
- setprop ro.HOME_APP_MEM 14336
- setprop ro.HIDDEN_APP_MEM 16384
- setprop ro.EMPTY_APP_MEM 20480
-
- # Old values for phones. Should probably be adjusted up for the next
- # phone version.
- #setprop ro.FOREGROUND_APP_MEM 2048
- #setprop ro.VISIBLE_APP_MEM 3072
- #setprop ro.PERCEPTIBLE_APP_MEM 4096
- #setprop ro.HEAVY_WEIGHT_APP_MEM 4096
- #setprop ro.SECONDARY_SERVER_MEM 6144
- #setprop ro.BACKUP_APP_MEM 6144
- #setprop ro.HOME_APP_MEM 6144
- #setprop ro.HIDDEN_APP_MEM 7168
- #setprop ro.EMPTY_APP_MEM 8192
-
-# Write value must be consistent with the above properties.
-# Note that the driver only supports 6 slots, so we have combined some of
-# the classes into the same memory level; the associated processes of higher
-# classes will still be killed first.
- write /sys/module/lowmemorykiller/parameters/adj 0,1,2,4,7,15
-
+# Memory management. Basic kernel parameters, and allow the high
+# level system server to be able to adjust the kernel OOM driver
+# paramters to match how it is managing things.
write /proc/sys/vm/overcommit_memory 1
write /proc/sys/vm/min_free_order_shift 4
- write /sys/module/lowmemorykiller/parameters/minfree 8192,10240,12288,14336,16384,20480
+ chown root system /sys/module/lowmemorykiller/parameters/adj
+ chmod 0664 /sys/module/lowmemorykiller/parameters/adj
+ chown root system /sys/module/lowmemorykiller/parameters/minfree
+ chmod 0664 /sys/module/lowmemorykiller/parameters/minfree
- # Set init its forked children's oom_adj.
+ # Set init and its forked children's oom_adj.
write /proc/1/oom_adj -16
# Tweak background writeout