memory overhead using from-import?

William Trenker wtrenker at
Sun Dec 21 16:58:59 CET 2003

Bengt Richter wrote:

> (which might be returned to python free pools rather than the system)

Ah.  So using the "ps" command (on Linux) to inspect the process's virtual memory size may not show me if memory for dereferenced objects is being freed for re-use within python's execution environment?

I snooped around on google, and read the profiler docs to try and find a python tool for measuring memory usage.  I haven't found anything, yet.  (Of course, the profiler focuses on execution times.)  Is there an api for inspecting python memory usage?  For example, is there a way to determine the memory freed by deleting an imported module, even if the freed memory is internal to python and can't be "seen" as a change to the total process memory allocated by the operating system?


More information about the Python-list mailing list