mirror of
https://github.com/mozilla/gecko-dev.git
synced 2024-11-30 00:01:50 +00:00
7b0a1f6dee
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. |
||
---|---|---|
.. | ||
client | ||
docs | ||
server | ||
shared | ||
.eslintrc | ||
.eslintrc.mochitests | ||
.eslintrc.xpcshell | ||
bootstrap.js | ||
chrome.manifest | ||
install.rdf | ||
moz.build | ||
templates.mozbuild |