Created
February 25, 2019 00:16
-
-
Save dtkav/0ce6d7b8e5707a89c1386470f8604fbe to your computer and use it in GitHub Desktop.
firefox, but in a memory limited cgroup
This file contains 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
#!/bin/bash | |
# create memory limited cgroup | |
sudo cgcreate -g memory:firefox | |
echo "5G" | sudo tee -a /sys/fs/cgroup/memory/firefox/memory.limit_in_bytes | |
echo "1" | sudo tee -a /sys/fs/cgroup/memory/firefox/memory.swappiness | |
# move shell to cgroup | |
echo $$ | sudo tee /sys/fs/cgroup/memory/firefox/tasks | |
# start firefox | |
nohup firefox & | |
disown |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment