Python process size
As part of our
PerformanceProject we will need to instrument Chandler, and get all kinds of timing etc. data programmatically out of the running application. Today I started wondering if there is any way to get the amount of memory the application is using from Python. I found one answer so far: the
resource module. According to the docs this should give the size of the process+it's children in bytes:
import resource
pages = resource.getrusage(RUSAGE_BOTH).ru_maxrss
total = pages * resource.getpagesize()
Available on Unix only
ASPN Python Cookbook also has some material, for Linux:
http://aspn.activestate.com/ASPN/Cookbook/Python/Recipe/286222