gecko-dev/devtools/server/performance
Nick Fitzgerald 7b0a1f6dee Bug 1261869 - Fix leaks in devtools; r=ejpbruel
There are two leaks addressed in this commit:

1. The thread actor's `_debuggerSourcesSeen` set was never cleared. This set
exists only as a performance optimization to speed up `_addSource` in cases
where we've already added the source. Unfortunately, this set wasn't getting
cleared when we cleared debuggees out and it ended up keeping the
`Debugger.Source`, its referent, and transitively its referent's global alive. I
figured it was simpler to make it a `WeakSet` than to add it as a special case
in `ThreadActor.prototype._clearDebuggees` and manage the lifetimes by hand. I
think this fits well with its intended use as an ephemeral performance
optimization.

2. Due to a logic error, we were not clearing debuggees in the memory actor's
`Debugger` instance on navigations. This isn't really a "proper" leak, in that
if you forced a GC, the old debuggees would go away as `Debugger` holds them
weakly, however if there was no GC between navigations, then you could still see
the old windows (and everything they "retained") as roots in the snapshot. This
issue is straightforward to fix once identified: ensure that `_clearDebuggees`
is actually called on navigation.

Finally, this commit adds a test that we don't leak Window objects when devtools
are open and we keep refreshing a tab. When it fails, it prints out the leaking
window's retaining paths.
2016-07-06 08:37:57 -07:00
..
framerate.js Bug 1271084 - Apply ESLint autofixes to ignored /devtools files. r=tromey 2016-05-18 12:49:23 -05:00
memory.js Bug 1261869 - Fix leaks in devtools; r=ejpbruel 2016-07-06 08:37:57 -07:00
moz.build
profiler.js Bug 1265869 - Add task.js and use in devtools. r=jryans 2016-05-17 13:07:55 -06:00
recorder.js Bug 1265869 - Add task.js and use in devtools. r=jryans 2016-05-17 13:07:55 -06:00
timeline.js Bug 1265869 - Add task.js and use in devtools. r=jryans 2016-05-17 13:07:55 -06:00