Last active
July 9, 2021 11:40
-
-
Save mjf/cc93243f2121523dcc1fe668ea915c1c to your computer and use it in GitHub Desktop.
Huge Pages for PID
This file contains hidden or 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 | |
[ $# -eq 1 ] && { | |
grep -B 11 'KernelPageSize' "/proc/$1/smaps" | | |
awk '/^Size:/ { sum += $2 } END { printf("%.2F GiB\n", sum / 1024 / 1024) }' | |
} || { | |
printf "Usage: %s PID\n" "${0##*/}" >&2 | |
exit 1 | |
} | |
# vi:ft=sh |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment