https://github.com/Malfoy/BCALM
Raw File
Tip revision: 07c86e0dccb6ea271d530c1f66e3483c31ddc935 authored by Malfoy on 15 January 2016, 15:32:36 UTC
Update README.md
Tip revision: 07c86e0
memused.sh
#!/bin/bash
"$@" &
cd /proc/$!
max=0
while [ -f status ]
do
sleep 0.1
if [ -f status ]
then
    mem=`cat status | grep VmHWM | tr -s [:blank:] | cut -d ' ' -f 2`
    if [ "0$mem" -gt "0$max" ]
    then
    max=$mem
    fi
fi;
done
echo "maximal memory used ( kilobyte(s) (K / Kb))" $max
back to top