gecko-dev/devtools
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
..
client Bug 1261869 - Fix leaks in devtools; r=ejpbruel 2016-07-06 08:37:57 -07:00
docs Bug 1240900 - Connect primary browser UI to the viewport. r=ochameau 2016-06-25 11:35:02 -05:00
server Bug 1261869 - Fix leaks in devtools; r=ejpbruel 2016-07-06 08:37:57 -07:00
shared Bug 1261869 - Fix leaks in devtools; r=ejpbruel 2016-07-06 08:37:57 -07:00
.eslintrc Bug 1283583 - Clean up code style in devtools/server/main.js. r=ochameau 2016-07-01 18:35:25 -05:00
.eslintrc.mochitests Bug 1235953 - Refactor responsive mode tests to use add_task to not use CPOWs and make sure they all wait for the off event. r=ochameau 2016-01-07 23:18:56 +01:00
.eslintrc.xpcshell Bug 1239437 - Allow run_test to be unused in xpcshell tests. r=pbrosset 2016-01-25 19:44:08 -06:00
bootstrap.js Bug 1271048 - Fix eslint issues in devtools/bootstrap.js. r=pbro 2016-05-10 00:15:03 +02:00
chrome.manifest Bug 1236905 - Use locale files from sources when using devtools addon. r=jryans 2016-01-08 06:59:35 -08:00
install.rdf Bug 1225108 - Introduce an addon to easily work on devtools codebase. r=jryans 2016-01-05 02:41:49 -08:00
moz.build
templates.mozbuild