[Greasemonkey] Possible source of memory leaks

Aaron Boodman zboogs at gmail.com
Sat Jul 9 11:30:50 EDT 2005

> > > I also just happened on this bug, which nails us again:
> > > "calling addEventListener with a closure holding a content node leaks
> > > the document"
> > > https://bugzilla.mozilla.org/show_bug.cgi?id=241518
> >
> > Again, do you have evidence of this? It's a pretty obvious pattern to
> > create a closure which holds a DOM node other than document, and I
> > usually avoid it like the plague.
> Sorry, I should have been clearer.  What I meant was, the closure in
> the callback handed to us by content might have DOM nodes.  We can't
> know we're not hanging on to stuff.

Ah. Yeah, that would be a major problem. In this particular case, we
are not using addEventListener, so hopefully we're OK there.

> > > These are meaty Moz bugs, and it's starting to hurt.
> > > I just had to admit to a coworker that his FF ate 200MB cuz of us.   I
> > > imagine there are many more similarly annoyed.
> >
> > I think maybe this embarassing situation with your coworker has
> > convinced you that there is some ongoing unwinnable battle with memory
> > leakage.
> Again, sorry for not being clear.  I meant mixing content w/ XUL seems
> to have been a bad idea, and we're bumping heads on XUL bugs pretty
> often.  I'd rather not expose APIs that are subject to breakage due to
> bugs not under our control.

I just feel like we don't know what we're doing. I'm just learning
XUL. I still feel like this is just the typical learning the sharp
edges of a platform stage.


More information about the Greasemonkey mailing list