|
|
|
|
|
by mnemonik
3870 days ago
|
|
Up until a couple months ago, it had an O(n^2) marking algorithm that kept iterating until it got to a fixed point. Thanks to the hard work of Steve Fink, these days it has an O(n) marking algorithm. See https://bugzilla.mozilla.org/show_bug.cgi?id=1164294 for the details. Edit to address your questions more directly: > how aggressive is Firefox in holding on to weakly referenced objects? They are just collected at the next GC slice where they are no longer retained. SpiderMonkey doesn't do anything to try and eagerly collect them. GC slices generally won'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's TODO list to revisit and clean these up. > does Firefox always continue to allocate memory from the host OS, or is there some threshold where it starts to let things slip? The threshold of how much is allocated before triggering GC grows as the retained set's size grows. This is bounded by available memory. Aaaaand I have a meeting I need to go attend. |
|