Skip to content

Instantly share code, notes, and snippets.

@draev
Last active November 23, 2017 10:16
Show Gist options
  • Save draev/b1cae946525d2c41810ec3d6b870f626 to your computer and use it in GitHub Desktop.
Save draev/b1cae946525d2c41810ec3d6b870f626 to your computer and use it in GitHub Desktop.
Memusage MacOS
#!/bin/bash
ps -eo rss,pid,user,command -m | awk '{ hr=$1/1024 ; printf("%13.2f Mb ",hr) } { for ( x=4 ; x<=NF ; x++ ) { printf("%s ",$x) } print "" }'
watch -n 1 -d 'memusage | grep <назвение скрипта> | grep -v grep'
@draev
Copy link
Author

draev commented Nov 23, 2017

to use in Linux, change line ps -eo rss,pid,user,command -m to ps -eo size,pid,user,command -sort --size

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment