Memory Cgroup topic in Android

168 views
Skip to first unread message

Zhao Junmin

unread,
Sep 4, 2015, 12:23:41 AM9/4/15
to android-platform
Hi All:

We find that google add some code for memory use in android.

from the init.rc, we see that a swap group for background process.
if the process in the swap group, it will swap more aggressive.

    # Create cgroup mount point for memory
    mount tmpfs none /sys/fs/cgroup mode=0750,uid=0,gid=1000
    mkdir /sys/fs/cgroup/memory 0750 root system
    mount cgroup none /sys/fs/cgroup/memory memory
    write /sys/fs/cgroup/memory/memory.move_charge_at_immigrate 1
    chown root system /sys/fs/cgroup/memory/tasks
    chmod 0660 /sys/fs/cgroup/memory/tasks
    mkdir /sys/fs/cgroup/memory/sw 0750 root system
    write /sys/fs/cgroup/memory/sw/memory.swappiness 100
    write /sys/fs/cgroup/memory/sw/memory.move_charge_at_immigrate 1
    chown root system /sys/fs/cgroup/memory/sw/tasks
    chmod 0660 /sys/fs/cgroup/memory/sw/tasks



But in Nexus or Samsung,  the CONFIG_MEMCG feature is disable,but I don't know why google don't use the feature?


Thanks
Zhaojunmin

Glenn Kasten

unread,
Sep 4, 2015, 10:59:44 AM9/4/15
to android-platform
It was not as effective as hoped, so it was disabled.

Zhao Junmin

unread,
Jan 25, 2016, 3:55:51 AM1/25/16
to android-platform
Thanks
Reply all
Reply to author
Forward
0 new messages