From a3fee2abd19ed0aedebc0f3949fb969f2ce7836e Mon Sep 17 00:00:00 2001 From: Patrick Simianer Date: Sat, 16 Aug 2014 21:27:58 +0100 Subject: memusg, to_ascii --- memusg | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) mode change 120000 => 100755 memusg (limited to 'memusg') diff --git a/memusg b/memusg deleted file mode 120000 index 5419241..0000000 --- a/memusg +++ /dev/null @@ -1 +0,0 @@ -memusg_git/memusg \ No newline at end of file diff --git a/memusg b/memusg new file mode 100755 index 0000000..a69daaa --- /dev/null +++ b/memusg @@ -0,0 +1,12 @@ +#!/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" + -- cgit v1.2.3