[PREVIEW] pymemdump memory profiler
John Arbash Meinel
john at arbash-meinel.com
Tue Apr 7 21:38:37 BST 2009
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1
Aaron Bentley wrote:
> John Arbash Meinel wrote:
>> The goal is to write a conversion into something like "Calltree" format,
>> so you could load the memory graph into KCacheGrind. In the medium term,
>> I've at least implemented the same summary info that you can get with
>> heapy. It also should be fairly easy to do the same "compare the current
>> heap with the previous heap", etc.
>
>
>> I haven't yet understood the calltree syntax, nor how I want to
>> exactly match things. Certainly you don't have FILE/LINE to put into
>> the output.
>
> I guess an alternative would be to add support to runsnakerun, whose
> author I actually know.
>
> http://www.vrplumber.com/programming/runsnakerun/
>
> Aaron
So I did go ahead and hack up runsnakerun a little bit to support memory
dumps. If you grab the latest version of:
lp:~jameinel/+junk/py_memory_dump
and
lp:~jameinel/runsnakerun/memory_dump_integration
It can load and display dump information. I've done some work to remove
problematic reference cycles. For example, functions always point to
modules, which then point back at the function. Going further, modules
tend to import other modules, and one of those modules eventually
imports 'sys' which has 'sys.modules', and you suddenly reference
everything in memory.
I'm still having some difficulty analyzing stuff that has refcycles,
because then the squaremap graph just fills up with recursive objects.
If someone has some thoughts there, I would be interested.
Anyway, it is pretty interesting. Navigating is a bit clumsy (you can
select callers, and get the squaremap graph of a parent, but to move the
listing you have to then click on the outermost box of the squaremap,
etc.) At least it has the basic "drill-down" and "drill-up" I was
looking for.
John
=:->
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.9 (Cygwin)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org
iEYEARECAAYFAknbuc0ACgkQJdeBCYSNAAN9gwCg16Kalpck3Vl5SbognHWqrJiU
5YcAoJPo0IqogdB8Vms4f/FKY6QWYzB8
=f4La
-----END PGP SIGNATURE-----
More information about the bazaar
mailing list