Stack Exchange network consists of 183 Q&A communities including Stack Overflow, the largest, most trusted online community for developers to learn, share their knowledge, and build their careers.
Firefox has a feature to do garbage collection and memory cleanup: On the about:memory page, Free memory > GC/CC/Minimize memory usage. Is it possible to trigger them externally, e.g. via a terminal command or a Python script?
Not sure if this helps, but the methods are in view-source:chrome://global/content/aboutMemory.js . E.G. function doGC(), which calls Cu.forceGC() .See developer.mozilla.org/en-US/docs/Mozilla/Tech/XPCOM/… for documatation. N.B " garbage collection is a very expensive operation"
Looks interesting, maybe, but I'm not really sure how to use this information... Regarding garbage collection, the features in about:memory are pretty quick and seem to take much less than a second
I was hoping there is a way to talk directly to the Firefox process via terminal, or maybe even start Firefox as a process inside Python and control it from there
about:memory
are pretty quick and seem to take much less than a second