Last active
March 14, 2023 23:47
-
-
Save littlefuntik/11122ab3535140c84c1b784144b14e37 to your computer and use it in GitHub Desktop.
Ubuntu/Linux get process memory usage(include child processes)
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
#!/bin/sh | |
pmap -x $(ps -fC "$1" | head -n2 | tail -n1 | awk '{print $2}') | tail -n 1 | awk '{print $3/1024 "MB"}' | |
# example usage: | |
# | |
# $ psmem chrome | |
# 1144.3MB |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment