> -----Original Message-----
> From: "Martin v. Löwis" [mailto:mar...@v.loewis.de]
> 
> This is easy in a debug build, using sys.getobjects(). In a release build, 
> you can
> use pympler:
> 
> start = pympler.muppy.get_size(pympler.muppy.get_objects())
> run_complicated_tests()
> end = pympler.muppy.get_size(pympler.muppy.get_objects())
> print "delta mem: %d" % (end-start)

Thanks for pointing out pympler to me.  Sounds like fun, I'll try it out.  
I should point out that gc.get_objects() also works, if you don't care about 
stuff like ints and floats.

Another reason why I like the runtime stats we have built in, however, is that 
they provide no query overhead.
You can query the current resource usage as often as you like and this is 
important in a running app.  We log python memory usage every second or so.

Cheers,

K

_______________________________________________
Python-Dev mailing list
Python-Dev@python.org
http://mail.python.org/mailman/listinfo/python-dev
Unsubscribe: 
http://mail.python.org/mailman/options/python-dev/archive%40mail-archive.com

Reply via email to