[Python-Dev] cpython: Implement PEP 412: Key-sharing dictionaries (closes #13903) (original) (raw)
Kristján Valur Jónsson kristjan at ccpgames.com
Thu Apr 26 15:26:47 CEST 2012
- Previous message: [Python-Dev] cpython: Implement PEP 412: Key-sharing dictionaries (closes #13903)
- Next message: [Python-Dev] (time) PEP 418 glossary V2
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
-----Original Message----- From: "Martin v. Löwis" [mailto:martin at v.loewis.de]
This is easy in a debug build, using sys.getobjects(). In a release build, you can use pympler: start = pympler.muppy.getsize(pympler.muppy.getobjects()) runcomplicatedtests() end = pympler.muppy.getsize(pympler.muppy.getobjects()) 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
- Previous message: [Python-Dev] cpython: Implement PEP 412: Key-sharing dictionaries (closes #13903)
- Next message: [Python-Dev] (time) PEP 418 glossary V2
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]