[Assorted-commits] SF.net SVN: assorted:[1467] shell-tools/trunk
Brought to you by:
yangzhang
From: <yan...@us...> - 2009-08-13 00:53:54
|
Revision: 1467 http://assorted.svn.sourceforge.net/assorted/?rev=1467&view=rev Author: yangzhang Date: 2009-08-13 00:53:35 +0000 (Thu, 13 Aug 2009) Log Message: ----------- added peakmem Modified Paths: -------------- shell-tools/trunk/README Added Paths: ----------- shell-tools/trunk/src/peakmem.bash Modified: shell-tools/trunk/README =================================================================== --- shell-tools/trunk/README 2009-08-12 22:27:41 UTC (rev 1466) +++ shell-tools/trunk/README 2009-08-13 00:53:35 UTC (rev 1467) @@ -108,6 +108,8 @@ (sequentially), but also be able to enter a [Pexpect] common password (useful when keys aren't set up. + +`peakmem` Run a process and get its peak memory usage. bash -------------------------------------------------------------------------------- [HSH]: http://software.complete.org/hsh/ Added: shell-tools/trunk/src/peakmem.bash =================================================================== --- shell-tools/trunk/src/peakmem.bash (rev 0) +++ shell-tools/trunk/src/peakmem.bash 2009-08-13 00:53:35 UTC (rev 1467) @@ -0,0 +1,9 @@ +#!/usr/bin/env bash +"$@" & # Run the given command line in the background. +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: $peak" 1>&2 Property changes on: shell-tools/trunk/src/peakmem.bash ___________________________________________________________________ Added: svn:executable + * This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |