embedded python -memory usage-by-types

Warren Postma embed at NO_SPAM_PLEASE.geocities.com
Wed Jan 3 16:43:42 EST 2001


A while back there was someone working on a memory usage debugging hack.  Is
anybody still working on this.

Output could be something like this:


Object                  Instances             Memory Usage (kb)
---------               -------------       ---------------------
String                       5000                 1100 kb
Interned Strings        900                    500 kb
Integer                     8000                  900 kb
Classes                    900                     400 kb
Instances                 1200                   1800kb
...
...

I have thought that some of the debugging features in Py 1.5.2 could be used
to build this information, especially when Py_TRACE_REFS is defined.

The dump_counts() function in pyobject.c is darn close, and I'm using it to
start me on my way.

Has anyone implemented something like this?  Anything more advanced either?

Warren Postma
ZTR Control Systems






More information about the Python-list mailing list