diff options
author | Patrick Simianer <p@simianer.de> | 2016-10-20 18:23:15 +0200 |
---|---|---|
committer | Patrick Simianer <p@simianer.de> | 2016-10-20 18:23:15 +0200 |
commit | 0cb8b41406452c17ebcb6801e45cf114e46187fa (patch) | |
tree | 1f9b953c2ff800fb3fdf8e238d570c14c38b7af5 /memory-usage | |
parent | 281872317a9ac5d4d62e6a6a2f5463cd20c65087 (diff) |
memory stuff
Diffstat (limited to 'memory-usage')
-rwxr-xr-x | memory-usage | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/memory-usage b/memory-usage new file mode 100755 index 0000000..5c2104f --- /dev/null +++ b/memory-usage @@ -0,0 +1,11 @@ +#!/bin/bash + +"$@" & +pid=$! peak=0 +while true; do + sleep 1 + sample="$(ps -o rss= $pid 2> /dev/null)" || break + let peak='sample > peak ? sample : peak' +done +echo "$(( ${peak%% *} / 1024)) m" + |