bugzilla.mozilla.org will be intermittently unavailable on Saturday, March 24th, from 16:00 until 20:00 UTC.

Programmatically get the memory usage of a worker




Async Tooling
4 years ago
4 years ago


(Reporter: Yoric, Unassigned)


Firefox Tracking Flags

(Not tracked)


Comment hidden (empty)
What do you mean by this?
Whiteboard: [Memshrink] → [MemShrink]
We would like to report through Telemetry the memory usage of specific workers. This requires an API that lets us get the information. I can live with doing this either from the worker itself or from the main thread.
This is hard for two reasons.

First, we have lots of reporters for different parts of the system.  But I'm trying very hard to avoid treating any of them as special.  E.g. about:memory just iterates through and displays all of them.  We actually used to pull out some of them specially -- telemetry did exactly this -- and then some of those reporters went away, and the implicit dependence was broken, and nobody noticed for months.  This is bad, and is why I introduced "distinguished amounts" in bug 913260 to fix this exact situation.  What you're asking goes against this.  Maybe there is a way to do it nicely, but...

Second, telemetry measurements have to be fast.  We've had multiple issues in the past with memory measurements that were reported by telemetry that were too slow, and caused hangs, and so were removed.  Getting the memory consumption of a worker requires iterating over every live thing in the worker's GC heap, and measuring all the malloc'd blocks that hang off those things.  This is not something that is appropriate for doing once per minute (or however telemetry runs).
Whiteboard: [MemShrink]
You need to log in before you can comment on or make changes to this bug.