You can get the exact number of bytes for Rss (resident set) from /proc/<pid>/stat
:
echo $(($(cat /proc/$(pgrep -n meminflate.exe)/stat | cut -d' ' -f24)*4096))
To explain: this reads /proc/<pid>/stat
(here the PID number is found using pgrep
), the uses cut
to only select the 24th field (Rss). Then the result is multiplied by 4096 (the normal page size on Linux). You can also only multiply it by 4 to get the size in kiB or divide it by 256 to get it in MiB.