I figured it out. There are two caches here, and their interplay causes unexpected behavior. The GlyphCache has a limit of 6MB and the TextureCache has a limit of 64MB. On this page, caching all the glyphs requires 11MB. However, 11MB is more than the glyph cache limit of 6MB, so the glyph cache starts evicting glyphs. However, it doesn't tell the texture cache about it - glyphs use `Eviction::Auto` in the texture cache, so the texture cache will evict them on its own, later. As we re-rasterize the glyphs that were evicted by the glyph cache, the texture cache grows, until it hits 64MB. On the other hand, if we increase the glyph cache limit to, say, 20MB, then the entire page fits in the glyph cache. The glyph cache no longer evicts anything. As a result, the texture cache stops growing once all the glyphs are present, at around 23MB (= 11MB of glyphs, plus some images). I'll repeat that, because it's very non-obvious: - With a glyph cache limit of 10MB, the texture cache tops out at 23MB. - With a glyph cache limit of 6MB, the texture cache grows until it hits 64MB.
Bug 1685744 Comment 1 Edit History
Note: The actual edited comment in the bug view page will always show the original commenter’s name and original timestamp.
I figured it out. There are two caches here, and their interplay causes unexpected behavior. The GlyphCache has a limit of 6MB and the TextureCache has a limit of 64MB. On this page, caching all the glyphs requires 11MB. However, 11MB is more than the glyph cache limit of 6MB, so the glyph cache starts evicting glyphs. However, it doesn't tell the texture cache about it - glyphs use `Eviction::Auto` in the texture cache, so the texture cache will evict them on its own, later. As we re-rasterize the glyphs that were evicted by the glyph cache, the texture cache grows, until it hits 64MB. On the other hand, if we increase the glyph cache limit to, say, 20MB, then the entire page fits in the glyph cache. The glyph cache no longer evicts anything. As a result, the texture cache stops growing once all the glyphs are present, at around 23MB (= 11MB of glyphs, plus some images). I'll repeat that, because it's very non-obvious: - With a glyph cache limit of 20MB, the texture cache tops out at 23MB. - With a glyph cache limit of 6MB, the texture cache grows until it hits 64MB.
I figured it out. There are two caches here, and their interplay causes unexpected behavior. The GlyphCache has a limit of 6MB and the TextureCache has a limit of 64MB. On this page, caching all the glyphs requires 11MB. However, 11MB is more than the glyph cache limit of 6MB, so the glyph cache starts evicting glyphs. However, it doesn't tell the texture cache about it - glyphs use `Eviction::Auto` in the texture cache, so the texture cache will evict them on its own, later. As we re-rasterize the glyphs that were evicted by the glyph cache, the texture cache grows, until it hits 64MB. On the other hand, if we increase the glyph cache limit to, say, 20MB, then the entire page fits in the glyph cache. The glyph cache no longer evicts anything. As a result, the texture cache stops growing once all the glyphs are present, at around 23MB (= 11MB of glyphs, plus some images). I'll repeat that, because it's very non-obvious: - With a glyph cache limit of 20MB, the texture cache tops out at 23MB. - With a glyph cache limit of 6MB, the texture cache grows until it hits its soft limit of 64MB.