1
0
mirror of https://github.com/aquatix/dotfiles.git synced 2025-12-06 22:55:10 +01:00

Handy script to get the real memory usage of a process

This commit is contained in:
2015-09-05 19:25:36 +02:00
parent 885e05bb11
commit 002dd2203d

9
bin/memused Executable file
View File

@@ -0,0 +1,9 @@
#!/bin/bash
# Written by Alexander Löhner
# The Linux Counter Project
if [[ "${1}" = "" ]]; then
echo "please add the name of the process as a parameter"
exit 1
fi
echo "scale=2; `for i in $(pidof ${1}); do echo 0 $(awk '/Private/ {print \"+\", $2}' /proc/$i/smaps) | bc ; done | xargs | sed \"s/ / \+ /g\" | bc`/1000" | bc