I would like to obtain, from within the Python program, the maximum physical memory used by a Python program (ActiveState Python 3.2, under Windows 7).
Ideally, every 0.1 sec or so, I'd like to have memory usage polled, and if it exceeds the maximum seen so far, the maximum value (a global variable stored somewhere), updated.
UPDATE:
I realize my question is a close duplicate of Which Python memory profiler is recommended?.
Sorry for being unclear. I have two specific problems that are not, to my knowledge, addressed by a regular memory profiler:
I need to see not only the memory allocated by Python, but the total memory used by the Python program (under Windows, this would include DLLs, etc.). In other words, under Windows, this is exactly what you'd see in the Task Manager.
I need to see the maximum memory rather than the memory at any given instant. I can't think of a way to do that other than to place numerous memory checks all around the code whenever I think I'm allocating something large.