From 0cb8b41406452c17ebcb6801e45cf114e46187fa Mon Sep 17 00:00:00 2001 From: Patrick Simianer
Date: Thu, 20 Oct 2016 18:23:15 +0200 Subject: memory stuff --- memory-usage | 11 +++++++++++ 1 file changed, 11 insertions(+) create mode 100755 memory-usage (limited to 'memory-usage') 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" + -- cgit v1.2.3