Are there any methods in (C)Python to inspect the process' current memory usage? In particular, I'd like to determine the high-water mark of memory usage in a testing script, but if necessary I don't mind periodically checking memory usage and calculating the high water mark for myself.
EDIT: I'm looking for either a pure-python solution, or something which works on OS X.
you can use os.getpid() to get your current PID and then use that PID to find the process in the output of a subprocess calling top/free/ps etc.
i'm not an OSX/BSD expert, so im unsure of the flags to which command will give you memory usage by process
Is it possible to get a "high water mark" of memory usage from Python?