+Usage: memusage.py [-o filename] command [args...]
Runs a subprocess, and measure its RSS (resident set size) every second.
At the end, print the maximum RSS measured, and some statistics.
-Also writes 'memusage.log', reporting every second the RSS.
+Also writes "filename", reporting every second the RSS. If filename is not
+given, the output is written to "memusage.log"
- print >> sys.stderr, __doc__
+ outname = 'memusage.log'
+ args # make sure there is at least one argument left
+ outname, args = parse_args()
+ print >> sys.stderr, __doc__.strip()
-f = open(
'memusage.log', 'w', 0)
+f = open(, 'w', 0)
while os.waitpid(childpid, os.WNOHANG) == 0: