Cycle collector helps finding leaks in Firefox

To help find memory leaks in Mozilla Firefox the Mozilla developers has the last couple of weeks landed the so called XPCOM cycle collector. This tool thats built into Mozilla helps to avoid memory leaks that can make Firefox take up too much memory and make it slower. It periodically checks the Firefox memory usage and tries to free any unused memory. More and more areas of the Firefox code will support this feature and hopefully we'll have a Firefox 3 that will use less memory.

But memory garbage collection, which the XPCOM cycle collector does, is hard, so dont expect miracles. Bugzilla reports that there's 237 open memory leak bugs

So how does it work. From the XPCOM cycle collector webpage:
The cycle collector spends most of its time accumulating (and forgetting about) pointers to XPCOM objects that might be involved in garbage cycles. Periodically the collector wakes up and examines any suspicious pointers that have been sitting in its buffer for a while. If the collector finds a group of objects that all refer back to one another, and establishes that the objects' reference counts are all accounted for by internal pointers within the group, it considers that group cyclical garbage, which it then attempts to free.

Read much more about the XPCOM cycle collector.

Read the meta bug about the collector.


June 26, 2007 10:31 PM | Posted in Mozilla

Ads:

Back Next

0 Comments

.
You're here: Home - Cycle collector helps finding leaks in Firefox
Get the Mozilla Firefox browser