Last active
July 7, 2019 12:37
-
-
Save bbak/f250e81ae40391630b9b73c673c936f2 to your computer and use it in GitHub Desktop.
Show count of used huge pages by process-ID
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/bash | |
# | |
IFS=$'\n' | |
for item in $(grep '^VmFlags:.* ht' /proc/[0-9]*/smaps | awk -F/ '{print $3}' | uniq); do | |
printf "%s:\t%d huge pages\n" "$(ps -p $item -o comm,pid --no-headers)" "$(cat /proc/$item/numa_maps | grep -o -P 'huge.*dirty=(\d+)' | sed -n "s/^.*dirty=\([[:digit:]]\{1,3\}\)/\1/p" | paste -s -d+ - | bc)" | |
done |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment