Closed Bug 1805996 Opened 3 years ago Closed 2 years ago

Consider if, and if so how to best, report Glean SDK memory use in Firefox Desktop

Categories

(Data Platform and Tools :: Glean: SDK, task, P1)

task

Tracking

(firefox128 fixed)

RESOLVED FIXED
Tracking Status
firefox128 --- fixed

People

(Reporter: chutten, Assigned: janerik)

References

(Blocks 2 open bugs)

Details

Attachments

(2 files)

As mentioned in bug 1804420 comment 5, Glean SDK memory's ending up in the "heap unclassified" bucket. We ought to be able to do better than this and report where all the memory's going.

That is, if this makes sense to the SDK at large. Webrender apparently has a good model to follow, and there are empty crates.io impls for malloc_size_of/malloc_size_of_derive which ought to assist. But I've not looked into it.

Also: it may make the most sense for FOG to be the only part that records memory, but I'm not sure how much memory is used internal to the SDK vs at a layer where FOG would be able to report it. Unsure, so I'm filing this as an SDK bug first.

Priority: -- → P4
See Also: → 1866783
Assignee: nobody → jrediger
Priority: P4 → P1

This currently measures:

  • Alloc size of all metrics
  • Alloc size of additional maps used for metrics
  • Alloc size of all pings

This requires a Glean update that implements all that malloc_size_of.

Downside:
The generated fog_metric_alloc_size is the 30th largest function in an
optimized build.
It's some 3000 lines long, because it has to call size_of on each and
every metric (majority of them use counters).
This will only grow with the number of metrics we add. I don't have a
solution for that yet.

Attachment #9395989 - Attachment description: WIP: Bug 1805996 - Implement a memory reporter for FOG → Bug 1805996 - Implement scaffolding for a memory reporter in FOG
Attachment #9395989 - Attachment description: Bug 1805996 - Implement scaffolding for a memory reporter in FOG → Bug 1805996 - Implement scaffolding for a memory reporter in FOG r?chutten!
Pushed by jrediger@mozilla.com: https://hg.mozilla.org/integration/autoland/rev/ea59a7108ca9 Implement scaffolding for a memory reporter in FOG r=chutten

Backed out for causing bc failures in nsCOMPtr.h

Flags: needinfo?(jrediger)

It looks like you need to add the new interface nsIMemoryReporter to the line NS_IMPL_ISUPPORTS(FOG, nsIFOG, nsIObserver).

Thanks! Will do that and run on try.

Flags: needinfo?(jrediger)
Pushed by jrediger@mozilla.com: https://hg.mozilla.org/integration/autoland/rev/929b7a06040f Implement scaffolding for a memory reporter in FOG r=chutten
Status: NEW → RESOLVED
Closed: 2 years ago
Resolution: --- → FIXED
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: