Created
August 8, 2018 13:56
-
-
Save chrisdone/9d99124f8ed5787b9de94ba3621cd376 to your computer and use it in GitHub Desktop.
Set cgroup limits on a process
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Create the group | |
sudo cgdelete memory:/emacs # Recreating it when making changes seems to help them take effect | |
sudo cgcreate -g memory:/emacs -t chris:chris | |
sudo cgset -r memory.swappiness=0 emacs | |
sudo cgset -r memory.limit_in_bytes=1GB emacs | |
# Run the process with memory limits | |
cgexec -g memory:emacs emacs |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment