Freetype Data can cause font cache to grow beyond expected limits |
||||||||||
Issue descriptionWhen Skia's glyph cache encounters a font it needs to handle, it creates FT_Face data using freetype and keeps that data cached until there are no further references. See: https://cs.chromium.org/chromium/src/third_party/skia/src/ports/SkFontHost_FreeType.cpp?sq=package:chromium&l=330 While this makes sense in general, the FT_Face data can be quite large (potentially MBs). Despite this, the size of FT_Face data is not currently estimated or counted. This means that the limits imposed on the glyph cache do not take into account the FT_Face data that is being kept alive. This can be a problem, especially on low-end devices where memory is very limited. To mitigate this, we may want to consider: - Counting/estimating the size of FT_Face data and including this in the Glyph Cache's eviction strategy. - Disabling web fonts on ultra-low-end devices (If web fonts are the culprit). For an example of a problematic site, see: instagram.com/badgalriri
,
Sep 11 2017
,
Sep 13 2017
Estimating/reporting the size would fall on skia as blink has knowledge of FT_Face. Disabling webfonts on the other hand would be a blink feature. Ben, could you comment on the feasibility of exposing the size of FT_Face?
,
Sep 20 2017
Exposing the size of the data hanging off an FT_Face would be up to FreeType, which I don't think currently has any means of doing so. On the other hand, we could try manually tracking, by creating a separate FT_Library for each FT_Face and creating the FT_Library with a FT_Memory which keeps track of total allocation. So in theory this is possible, but it would require a bit of work as well as additional (memory) overhead.
,
Nov 2 2017
Sounds like it would be a bit of work to accurately track webfont size. On the other hand, I assume that disabling WebFonts wouldn't be too hard. Do we have any UMAs or other metrics to help understand how often WebFonts are used on mobile sites?
,
Dec 5 2017
Ping for bungeman
,
Dec 5 2017
I don't think Ben is the right person to answer the WebFonts/UMA question, more for Blink/Chrome (?) he's also out on leave, maybe checking in some...
,
Dec 7 2017
,
Jan 10 2018
,
Jan 17 2018
eae@, can you help answer the UMA/metrics question from #5 (or do you know who would know this?).
,
Jan 31 2018
Hi, the webfonts team should know, reassigning.
,
Mar 16 2018
Hi Web Fonts team, can you please help us here?
,
Mar 16 2018
,
Mar 19 2018
WebFont.WebFontsInPage UMA tracks the number of web fonts used in a page. On Android, ~7% of the page loads have at least one web font.
,
May 8 2018
|
||||||||||
►
Sign in to add a comment |
||||||||||
Comment 1 by chrishtr@chromium.org
, Sep 11 2017Status: Untriaged (was: Available)