I have a python application that has some performance hiccups. I want to add the garbage collector's events (especially, when does it get called) to my logs. Is it possible?
thanks.
http://docs.python.org/library/gc.html#gc.set_debug
You can set the Flags, but they get written to stderr.
Available flags are
gc.DEBUG_STATS
gc.DEBUG_COLLECTABLE
gc.DEBUG_UNCOLLECTABLE
gc.DEBUG_INSTANCES
gc.DEBUG_OBJECTS
gc.DEBUG_SAVEALL
gc.DEBUG_LEAK
ALSO
When you are dealing with performance, you might wish to profile your code for exhaustive Loops or Function calls. You can use cProfile or hotshot. More here http://docs.python.org/library/profile.html
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With