2

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?

3
  • 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" Commented Jul 19, 2020 at 19:20
  • 2
    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
    – david
    Commented Jul 19, 2020 at 19:58
  • 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
    – david
    Commented Jul 19, 2020 at 19:59

0

You must log in to answer this question.

Browse other questions tagged .