Make GC much more aggressive
@gcampagna
Submitted by Giovanni Campagna Link to original bug (#679688)
Description
This is a follow up of bug 678504. Essentially, our current GC strategies tend to root much more than necessary, and this results in high memory consumption (if not outright leaks, like bug 679376). I prepared a series of patches that address this. I've been running them for a while, and didn't see regressions. They introduce a subtle API change, as callbacks become rooted to the object they're installed on, and thus become invalid if nothing keeps the object alive but the callback.
OTOH, it's yet to be proven that this patches are effective at reducing memory usage. Considering normal usage patterns, I saw little to no difference for gnome-shell (around 1000 objects in lg). I did observe a marked difference (up to 30/40 MB) in gnome-documents: memory is now correctly freed when closing a document. There are still leaks when opening and closing a collection, although that could be a lifetime issue in JS.