Skip to content

Instantly share code, notes, and snippets.

@mrm8488
Created January 24, 2020 15:09
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save mrm8488/0e011b89c60d4b86340147124b0b0bc6 to your computer and use it in GitHub Desktop.
Save mrm8488/0e011b89c60d4b86340147124b0b0bc6 to your computer and use it in GitHub Desktop.
Profile memory usage of a script
while ps auxw | grep '[m]yscript'; do sleep 30; done | stdbuf -o0 uniq | ts
# Monitor changes in memory usage of myscript and timestamp the lines using ts. stdbuf -o0 turns off output buffering. [m] in the grep expression prevents the grep process line itself from being matched.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment