Closed Bug 1727837 Opened 3 years ago Closed 3 years ago

Provider helpers to display the dominators of any given javascript object

Categories

(DevTools :: Framework, enhancement)

enhancement

Tracking

(firefox94 fixed)

RESOLVED FIXED
94 Branch
Tracking Status
firefox94 --- fixed

People

(Reporter: ochameau, Assigned: ochameau)

References

Details

(Whiteboard: dt-perf-stability-mvp)

Attachments

(1 file, 1 obsolete file)

To pile up on top of bug 1539518, we could also have an API to instruct the test helper to display the "dominators" of any given JS object of DevTools.
Dominators are the objects which are referencing another one and justify why the given object is still being allocated.
Such information is crutial when it comes to understand why an object is leaked.

Bug 1539518 will help narrow to which particular object is being leaked, and this feature will help understand why in a very efficient maner.

This API, to be enabled locally and manually via DEBUG_ALLOCATIONS=1 env variable,
helps knowing why a given JS object it being kept alive.

You also have to manually hack your codebase to tell which precise object instances
you want to trace.

Whiteboard: dt-perf-stability-triage → dt-perf-stability-mvp
Attached file Bug 1727837 - [devtools] Simulate a target front leak (obsolete) (deleted) —

You can see the new helper output by running:

$ ./mach mochitest devtools/client/framework/test/allocations/browser_allocations_target.js  --headless

[...]

 0:16.84 GECKO(646818)  # Tracing: Object@Pool.js:27
 0:16.84 GECKO(646818) ### Path(s) from root:
 0:17.17 GECKO(646818) - other@no-stack:undefined.WeakMap entry value
 0:17.17 GECKO(646818)  \--> LexicalEnvironment@base-loader.js:160.**UNKNOWN SLOT 1**
 0:17.17 GECKO(646818)  \--> Object@base-loader.js:155.g
 0:17.17 GECKO(646818)  \--> Array@target-mixin.js:38.objectElements[0]
 0:17.17 GECKO(646818)  \--> Object@target-mixin.js:46.seeMyCustomAttributeHere
 0:17.17 GECKO(646818)  \--> Object@Pool.js:27
 0:17.17 GECKO(646818)  # Tracing: Object@Pool.js:27
Pushed by apoirot@mozilla.com: https://hg.mozilla.org/integration/autoland/rev/bea832932e37 [devtools] Add API to log dominators of suspicious objects. r=jdescottes
Blocks: 1730507
Status: NEW → RESOLVED
Closed: 3 years ago
Resolution: --- → FIXED
Target Milestone: --- → 94 Branch
Attachment #9240089 - Attachment is obsolete: true
Blocks: 1731530
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: