Make native-font-resource-mac memory reporter expandable and add font list with details
Categories
(Core :: Graphics, enhancement)
Tracking
()
Tracking | Status | |
---|---|---|
firefox84 | --- | fixed |
People
(Reporter: whimboo, Assigned: bradwerth)
References
Details
Attachments
(3 files, 2 obsolete files)
+++ This bug was initially created as a clone of Bug #1674175 +++
To have a better idea were memory has been allocated we should display a list of native fonts as created under native-font-resource-mac
including the font family, URL, and principal similar to user-fonts
:
├──9.69 MB (01.21%) -- user-fonts
│ │ ├──1.43 MB (00.18%) ── font(family=Twemoji, url=https://chat.mozilla.org/fonts/Twemoji_Mozilla/TwemojiMozilla-colr.5bb743a.woff2, principal=https://chat.mozilla.org/#/room/#interop:mozilla.org)
│ │ ├──0.34 MB (00.04%) ── font(family=docs-EB Garamond, url=https://fonts.gstatic.com/s/ebgaramond/v14/SlGDmQSNjdsmc35JDF1K5E55YMjF_7DPuGi-6_RUAIV-e62PgQ.woff, principal=https://docs.google.com/document/d/13Ecva5JMjeCTteDUd4bpvGyCVNq2T2ZthRABW_XE5UA/edit#)
Comment 1•4 years ago
|
||
Yeah, we should be able to at least pull the family out of the font and add that to the set tracking the native font resource data here:
https://searchfox.org/mozilla-central/source/gfx/2d/NativeFontResourceMac.cpp#78
Assignee | ||
Updated•4 years ago
|
Assignee | ||
Comment 2•4 years ago
|
||
The new helper function AllocateCGFontFromData can be used to create the
font reference objects from the cached font data in sWeakFontDataSet, which
will be useful for memory reporting.
Assignee | ||
Comment 3•4 years ago
|
||
Depends on D95972
Updated•4 years ago
|
Updated•4 years ago
|
Assignee | ||
Comment 4•4 years ago
|
||
Any CT "Create" method returns an owned object. This ensures that owned
objects are deallocated when the font fails to be crated. It also prevents
unused font data from being entered into the font data set (where it would
never be deallocated).
Assignee | ||
Comment 5•4 years ago
|
||
This moves from unordered_set to unordered_map to accommodate storing the font
name alongside the font data.
Depends on D96121
Assignee | ||
Comment 6•4 years ago
|
||
If there is no font name stored, this reports "Unknown(#)" with the index of
the font in the map.
Depends on D96122
Comment 8•4 years ago
|
||
bugherder |
https://hg.mozilla.org/mozilla-central/rev/5015220441e6
https://hg.mozilla.org/mozilla-central/rev/5028739d84dd
https://hg.mozilla.org/mozilla-central/rev/3d281d6985bf
Reporter | ||
Comment 9•4 years ago
|
||
(In reply to Henrik Skupin (:whimboo) [⌚️UTC+2] from comment #0)
├──9.69 MB (01.21%) -- user-fonts │ │ ├──1.43 MB (00.18%) ── font(family=Twemoji, url=https://chat.mozilla.org/fonts/Twemoji_Mozilla/TwemojiMozilla-colr.5bb743a.woff2, principal=https://chat.mozilla.org/#/room/#interop:mozilla.org) │ │ ├──0.34 MB (00.04%) ── font(family=docs-EB Garamond, url=https://fonts.gstatic.com/s/ebgaramond/v14/SlGDmQSNjdsmc35JDF1K5E55YMjF_7DPuGi-6_RUAIV-e62PgQ.woff, principal=https://docs.google.com/document/d/13Ecva5JMjeCTteDUd4bpvGyCVNq2T2ZthRABW_XE5UA/edit#)
So compared to user fonts I see a different reporting for native font resource:
│ ├──200.45 MB (32.20%) -- native-font-resource-mac
│ │ ├──198.30 MB (31.86%) ── AppleColorEmoji
Aren't we able to use the same details? It would be really good to know which site actually loaded the font.
Comment 10•4 years ago
|
||
It's not all that valuable because with the patches from bug 1625590 we will stop allocating data for that font.
Assignee | ||
Comment 11•4 years ago
|
||
(In reply to Henrik Skupin (:whimboo) [⌚️UTC+2] from comment #9)
(In reply to Henrik Skupin (:whimboo) [⌚️UTC+2] from comment #0)
├──9.69 MB (01.21%) -- user-fonts │ │ ├──1.43 MB (00.18%) ── font(family=Twemoji, url=https://chat.mozilla.org/fonts/Twemoji_Mozilla/TwemojiMozilla-colr.5bb743a.woff2, principal=https://chat.mozilla.org/#/room/#interop:mozilla.org) │ │ ├──0.34 MB (00.04%) ── font(family=docs-EB Garamond, url=https://fonts.gstatic.com/s/ebgaramond/v14/SlGDmQSNjdsmc35JDF1K5E55YMjF_7DPuGi-6_RUAIV-e62PgQ.woff, principal=https://docs.google.com/document/d/13Ecva5JMjeCTteDUd4bpvGyCVNq2T2ZthRABW_XE5UA/edit#)
So compared to user fonts I see a different reporting for native font resource:
│ ├──200.45 MB (32.20%) -- native-font-resource-mac │ │ ├──198.30 MB (31.86%) ── AppleColorEmoji
Aren't we able to use the same details? It would be really good to know which site actually loaded the font.
I'll open a new bug to make the native-font-resource-mac format match the user-fonts format.
Description
•