Closed Bug 1250058 Opened 4 years ago Closed 10 months ago

docShell leak on e10s debug when using getTestActorWithoutToolbox

Categories

(DevTools :: General, defect, P2)

x86_64
Windows 7
defect

Tracking

(Not tracked)

RESOLVED INACTIVE

People

(Reporter: jdescottes, Unassigned)

References

(Blocks 2 open bugs)

Details

(Keywords: memory-leak, Whiteboard: [btpp-fix-later])

Attachments

(1 file)

Follow up to bug 1244120. 

Locally this issue only happens on windows7, with a debug non-optimized build.
Tests impacted : 
- devtools/client/inspector/test/browser_inspector_initialization.js
- devtools/client/inspector/rules/test/browser_rules_content_02.js

STRs :
- build application on Win7 with --enable-debug & --disable-optimize
- run one of the tests mentioned above with ./mach mochitest --e10s

Actual : 1 docShell is leaked
Expected : no leak
tracking-e10s: --- → +
See Also: → 1252201
Affects OSX as well.
Duplicate of this bug: 1252278
Assignee: nobody → jdescottes
Status: NEW → ASSIGNED
And Linux.
Summary: docShell leak on windows7 e10s debug when using getTestActorWithoutToolbox → docShell leak on e10s debug when using getTestActorWithoutToolbox
Filter on TEAPOT-SPLINES.
Priority: -- → P2
Whiteboard: [btpp-fix-later]
I am stuck in my investigation and would need help here. Attaching a "reduced" test case here. In the test, you can see the various combinations that leak and those that don't.

Long story short, if at any point, a TestActor connection is live when opening the toolbox or when creating another TestActor, a docshell leaks. If the connection is closed before doing that, no leak.

Not included in this patch, I also tried to implement a better destroy for the test actor, without success.

Alex: I think you know the test-actor well, any idea what could be going wrong here? Also would be happy to take any suggestion regarding tools/methods to investigate docshell leaks.
Flags: needinfo?(poirot.alex)
Hum. I would have to dig deeper into this to provide really useful comment...
May be that's related to actor-registry actor which is used in test-actor-registry.js?
May that's him keeping stuff alive? I really don't know.

But here is a little trick I'm using to help figuring out what leaks.
Memory panel is meant to provide new console methods to do even better, but I haven't heard it being implemented yet?

let weak = Cu.getWeakReference(myObject);
require("sdk/timers").setInterval(function () { // /!\ do not use arrow function here as it keeps 'this' alive!!
  Cu.forceCC(); Cu.forceGC();
  if (weak.get()) {
    dump("myObject is still alive\n");
  }
}, 2000);

This snippet is handy if you execute a test with --keep-open, or 'yield new Promise(function () {})' just after a known leak. It allows to narrow down to what leaks. It is laborious, but it's better than nothing ;)
Flags: needinfo?(poirot.alex)
Product: Firefox → DevTools
Assignee: jdescottes → nobody
Status: ASSIGNED → NEW
tracking-e10s: + → ---
The leave-open keyword is there and there is no activity for 6 months.
:pbro, maybe it's time to close this bug?
Flags: needinfo?(pbrosset)
Status: NEW → RESOLVED
Closed: 10 months ago
Flags: needinfo?(pbrosset)
Resolution: --- → INACTIVE
You need to log in before you can comment on or make changes to this bug.