| allocation-tracker.js |
This file helps tracking Javascript object allocations.
It is only included in local builds as a debugging helper.
It is typicaly used when running DevTools tests (either mochitests or DAMP).
To use it, you need to set the following environment variable:
DEBUG_DEVTOOLS_ALLOCATIONS="normal"
This will only print the number of JS objects created during your test.
DEBUG_DEVTOOLS_ALLOCATIONS="verbose"
This will print the allocation sites of all the JS objects created during your
test. i.e. from which files and lines the objects have been created.
In both cases, look for "DEVTOOLS ALLOCATION" in your terminal to see tracker's
output.
But you can also import it from your test script if you want to focus on one
particular piece of code:
const { allocationTracker } =
require("devtools/shared/test-helpers/allocation-tracker");
// Calling `allocationTracker` will immediately start recording allocations
let tracker = allocationTracker();
// Do something
// If you want to log all the allocation sites, call this method:
tracker.logAllocationLog();
// Or, if you want to only print the number of objects being allocated, call this:
tracker.logCount();
// Once you are done, stop the tracker as it slow down execution a lot.
tracker.stop();
|
17617 |
| browser.toml |
|
455 |
| browser_allocation_tracker.js |
Any copyright is dedicated to the Public Domain.
http://creativecommons.org/publicdomain/zero/1.0/ |
7854 |
| browser_dump_scope.js |
Any copyright is dedicated to the Public Domain.
http://creativecommons.org/publicdomain/zero/1.0/ |
7357 |
| cc-analyzer.sys.mjs |
Helper class to retrieve CC/GC Logs via nsICycleCollectorListener interface.
|
3813 |
| dump-scope.sys.mjs |
eslint-disable no-console |
9295 |
| moz.build |
|
478 |
| test-line-tracer.js |
|
5846 |
| test-stepper.js |
|
2871 |
| trace-objects.sys.mjs |
Print information about why a list of objects are being held in memory.
@param Array<Object {weakRef: Object, ubiNodeId: String> leakedObjects
List of object with 'weakRef' attribute pointing to a leaked object,
and 'ubiNodeId' attribute refering to a ubi::Node's id.
ubi::Node::Id can be retrieved via ChromeUtils.getObjectNodeId.
(we don't compute the ubi::Node::Id from this method as it may be computed from
the content process and 'weakRef' may be null here)
@param String snapshotFile
Absolute path to a Heap snapshot file retrieved via this.getSnapshotFile.
This is used to trace content process objects. We have to record the snapshot
from the content process, but can only read it from the parent process because
of I/O restrictions in content processes.
|
11388 |
| tracked-objects.sys.mjs |
Request to track why the given object is kept in memory,
later on, when retrieving all the watched object via getStillAllocatedObjects.
|
1716 |