While it help understanding what particular code is creating many JS objects,
it doesn't help tracking memory leaks as it doesn't tell you which allocations are still alive or freed. It only tells you about where objects were allocated.
We could probably use
memory.takeCensus in order to provide a view on the still-allocated objects, which would ignore all the allocations that have been freed.
Then, once we have this view, we can probably collect a metric, similar to modules metrics introduced in bug 1458194.
The view would help trying to figure out some leaks while the record would help prevent regressions.