https://bugs.documentfoundation.org/show_bug.cgi?id=159529
--- Comment #15 from Patrick Luby <[email protected]> --- So I now know what is going on. This looks like a Collabora/LibreOffice Online optimization in the FontNameBox. Sometime in the past LibreOffice decided to cache a bitmap for every font available. But to fit the font name into a standard size, there is a loop in shrinkFontToFit() in svtools/source/control/ctrlbox.cxx that fetches the glyph bounding rectangle in each pass through the loop. Fetching the glyph bounding rectangle causes HarfBuzz to copy one of the font's internal tables. The fetched table is a full copy in memory and it appears to not be deleted until the enclosing LibreOffice PhysicalFont is deteled. Problem is that Apple bundles a number of fonts that cover all supported languages. Some of these fonts e.g. CJK fonts are very large and so creating the images for each font in the FontNameBox not only loads every installed font, it also basically makes a copy of each in memory. That is why you see the 180 MB of allocations in attachment #192605 in CoreTextFontFace::GetHbTable(). Also, since the array of PhysicalFont instances that represent all installed fonts don't get deleted because the FontNameBox has a reference to them, Instruments doesn't see a leak. So this bug really is case of excessive caching. I don't know anything about HarfBuzz or where this change occurred so I haven't been able to figure about where the copy can be deleted. But clearly making a copy of every installed font file seems uses a very, very large amount of memory. So, I think we should stop caching the font table in a PhysicalFont and delete the font table immediately after use. Anyone know what commit this change was made in? -- You are receiving this mail because: You are the assignee for the bug.
