3 ms·
This is a very interesting approach, what happened with memory footprint when you did this?
by JanisL 8y ago
This is a very interesting approach, what happened with memory footprint when you did this?
- kahseng 8y agoThanks, don't think I saw much impact at all in aggregate - our memory consumption on these web servers were dominated by objects we intentionally stored per request or globally, and not temporary/unreferenced python objects.
- JanisL 8y agoNice! I'll have to give this a try at some point if I run into GC related latency issues and see if it works on my systems.
- cma 8y agoEven while GC is delayed Python (CPython at least) will free some stuff through reference counting. Only circularly referenced stuff should stick around until the next GC run. So that can avoid lots of stack temporaries and stuff.
- Doxin 8y agoTheoretically with your code structured right you can disable the cyclical garbage collector outright: It only deals with reference cycles which you can explicitly avoid by using the weakref module. Not entirely sure how you'd go about writing code like that, but it's possible.