Skip to content

Instantly share code, notes, and snippets.

@gbaptista
Created February 25, 2018 23:54
Show Gist options
  • Save gbaptista/e98aebce15792639579dae5746cb8070 to your computer and use it in GitHub Desktop.
Save gbaptista/e98aebce15792639579dae5746cb8070 to your computer and use it in GitHub Desktop.
Don't let Chromium, Chrome, Firefox or Atom freeze your system!
# # https://lzone.de/cheat-sheet/ulimit
#
# ps aux | grep 'chromium\|atom' | awk '{print $2}'
#
# ps aux | grep 'chromium\|atom' | awk '{print $2}' | xargs pmap -x | grep total
#
#
# ps aux | grep 'chromium\|atom' | awk '{print $2}' | xargs -I % prlimit -p %
#
#
#
# ps aux | grep 'chromium\|atom' | awk '{print $2}' | xargs -I % prlimit -p %
#
# # prlimit --pid <pid> --<resource>=<soft limit>:<hard limit>
#
# ps aux | grep 'chromium' | awk '{print $2}'
#
# ps aux | grep 'chromium' | awk '{print $2}' | xargs pmap -x | grep total
#
# ps aux | grep 'chromium' | awk '{print $2}' | xargs pmap -x | grep total | awk '{print $4}' | awk '{ SUM += $1} END { print SUM }'
# ps aux | grep 'chromium' | awk '{print $2}' | xargs -I % prlimit -p % --rss=10:10
# 6gb ~ 7 gb
ps aux | grep 'chromium' | awk '{print $2}' | xargs -I % prlimit -p % --as=6000000000:7000000000
# 2gb ~ 3 gb
ps aux | grep 'atom' | awk '{print $2}' | xargs -I % prlimit -p % --as=3000000000:4000000000
# ps aux | grep 'chromium\|atom' | awk '{print $2}' | xargs -I % prlimit -p % --rttime=5000000:5000000
# ps aux | grep 'chromium\|atom' | awk '{print $2}' | xargs -I % prlimit -p % --stack=15000000:15000000
# ps aux | grep 'chromium\|atom' | awk '{print $2}' | xargs -I % prlimit -p % | grep 'RSS\|RTTIME\|stack'
# ps aux | grep -m 1 'chromium' | awk '{print $2}' | xargs -I % prlimit --pid %
# ps aux | grep -m 1 'atom' | awk '{print $2}' | xargs -I % prlimit --pid %
#
#
# ps aux | grep 'chromium' | awk '{print $2}' | xargs pmap -x | grep total | awk '{print $4}' | awk '{ SUM += $1} END { print SUM }'
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment