Created
January 24, 2020 15:09
-
-
Save mrm8488/0e011b89c60d4b86340147124b0b0bc6 to your computer and use it in GitHub Desktop.
Profile memory usage of a script
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
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