Skip to content

Instantly share code, notes, and snippets.

@SuperQ
Created October 31, 2016 16:01
Show Gist options
  • Save SuperQ/8188367b48c3fe8a5d0526ddaf45b376 to your computer and use it in GitHub Desktop.
Save SuperQ/8188367b48c3fe8a5d0526ddaf45b376 to your computer and use it in GitHub Desktop.
Primitive init.d cgroup handler
cgroup=SERVICE
if [ ! -d /cgroup/${cgroup} ] ; then
mkdir -p /cgroup/${cgroup}
fi
echo 3 > /cgroup/${cgroup}/memory.move_charge_at_immigrate
echo $$ > /cgroup/${cgroup}/cgroup.procs
echo 32M > /cgroup/${cgroup}/memory.limit_in_bytes
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment