[Libreoffice-bugs] [Bug 133667] Memory usage increases with 20 MB style setting font change and closing the document doesn't free the memory

bugzilla-daemon at bugs.documentfoundation.org bugzilla-daemon at bugs.documentfoundation.org
Mon Jun 15 10:33:42 UTC 2020


https://bugs.documentfoundation.org/show_bug.cgi?id=133667

--- Comment #6 from Miklos Vajna <vmiklos at collabora.com> ---
> Is possible explain this a bit more in detail, what the 'cache' does.

Sure. If you don't cache vcl-level text layout calls, then let's say you want
to draw "foo bar" on the screen. First you measure the text if "foo bar" fits
into the current line, or perhaps you need to break it down to "foo" and "bar"
(for that, you need to find a break point which is earlier than the end of
"bar"), and finally you want to draw the text. Without a cache, this means we
lay out the text (turn an unicode string into a list of positioned glyphs) at
least 3 times, sometimes even more.

The cache means that in case we already know the positioned glyph list of e.g.
"foo", we don't call into harfbuzz to lay it out again.

>What a layout run triggers. And when the layout run ends.. 

If you change the document model in any way (like press a key), you need to
(incrementally) update the layout, then the rendering can draw the layout. So
the layout run happens every time anything changes in the document that affects
rendering. Pressing a key, inserting a new paragraph, etc.

Export to an editable file format typically doesn't change the document (ODT,
DOCX, etc), so should not trigger a layout run.

-- 
You are receiving this mail because:
You are the assignee for the bug.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.freedesktop.org/archives/libreoffice-bugs/attachments/20200615/fdcd4a01/attachment.htm>


More information about the Libreoffice-bugs mailing list