Last active
September 3, 2016 14:56
-
-
Save vnegrisolo/59088db7d4851ab835afa244a8ea8bb0 to your computer and use it in GitHub Desktop.
Inspect memory used by a Ruby process
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
MEM = "ps ax -o pid,rss | grep -E '^[[:space:]]*#{$$}' | awk '{print $2}'" | |
def mem | |
`#{MEM}`.strip.to_i | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment