Skip to content

Instantly share code, notes, and snippets.

@vnegrisolo
Last active September 3, 2016 14:56
Show Gist options
  • Save vnegrisolo/59088db7d4851ab835afa244a8ea8bb0 to your computer and use it in GitHub Desktop.
Save vnegrisolo/59088db7d4851ab835afa244a8ea8bb0 to your computer and use it in GitHub Desktop.
Inspect memory used by a Ruby process
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