memoru usage of process

MrJean1 MrJean1 at gmail.com
Tue Sep 27 16:17:07 EDT 2005


On Linux, this may work for you

  <http://aspn.activestate.com/ASPN/Cookbook/Python/Recipe/286222>

/Jean Brouwers



Jacek Poplawski wrote:
> I need to know how much memory uses child process (after
> subprocess.Popen), so I want function:
>
> get_memory_usage(pid)
>
> I found two ways:
>
> - call "ps" and analyze its output - this is not portable (different
> output on Linux, Cygwin and QNX)
>
> - use resource.getrusage - but it works for self/children, not for
> single process with given pid
> 
> Do you know any ideas how to do it in Python?




More information about the Python-list mailing list