Up until a couple months ago, it had an O(n^2) marking algorithm that kept iterating until it got to a fixed point.<p>Thanks to the hard work of Steve Fink, these days it has an O(n) marking algorithm. See <a href="https:&#x2F;&#x2F;bugzilla.mozilla.org&#x2F;show_bug.cgi?id=1164294" rel="nofollow">https:&#x2F;&#x2F;bugzilla.mozilla.org&#x2F;show_bug.cgi?id=1164294</a> for the details.<p>Edit to address your questions more directly:<p><i>&gt; how aggressive is Firefox in holding on to weakly referenced objects?</i><p>They are just collected at the next GC slice where they are no longer retained. SpiderMonkey doesn&#x27;t do anything to try and eagerly collect them. GC slices generally won&#x27;t happen until either there has been enough pressure (allocations) to trigger one or the user is inactive for N amount of time. There are tons of GC triggering heuristics and some are probably not optimal. It is on the GC team&#x27;s TODO list to revisit and clean these up.<p><i>&gt; does Firefox always continue to allocate memory from the host OS, or is there some threshold where it starts to let things slip?</i><p>The threshold of how much is allocated before triggering GC grows as the retained set&#x27;s size grows. This is bounded by available memory.<p>Aaaaand I have a meeting I need to go attend.