Last Comment Bug 708075 - the shaped-word caches should be flushed on memory-pressure notification
: the shaped-word caches should be flushed on memory-pressure notification
Status: RESOLVED FIXED
[MemShrink]
:
Product: Core
Classification: Components
Component: Layout: Text (show other bugs)
: unspecified
: All All
: -- normal (vote)
: mozilla12
Assigned To: Jonathan Kew (:jfkthame)
:
Mentors:
Depends on: 703100
Blocks: 710501
  Show dependency treegraph
 
Reported: 2011-12-06 13:32 PST by Jonathan Kew (:jfkthame)
Modified: 2012-01-14 01:35 PST (History)
7 users (show)
See Also:
Crash Signature:
(edit)
QA Whiteboard:
Iteration: ---
Points: ---
Has Regression Range: ---
Has STR: ---


Attachments
observe memory-pressure notification and discard cached gfxShapedWord records. (7.08 KB, patch)
2011-12-08 05:17 PST, Jonathan Kew (:jfkthame)
roc: review+
Details | Diff | Splinter Review
patch, v2 - observe memory-pressure notification and discard cached gfxShapedWord records (6.23 KB, patch)
2012-01-13 02:04 PST, Jonathan Kew (:jfkthame)
roc: review+
Details | Diff | Splinter Review

Description Jonathan Kew (:jfkthame) 2011-12-06 13:32:56 PST
The caches for per-font/word shaped glyph data (introduced in bug 703100, replacing gfxTextRunWordCache) should observe the memory-pressure notification and discard cached words when memory is low.

This would have been difficult to do in the old gfxTextRunWordCache world, because of the complex ownership and referencing of the glyph data, but with the per-gfxFont shaped-word caches, it should be simple. This will then allow us to keep shaped-word data in the cache longer for potential re-use, knowing that it will be evicted if necessary.
Comment 1 Jet Villegas (:jet) 2011-12-07 11:15:23 PST
I love this idea. Do you plan on having this land together with the cache changes, or after?
Comment 2 Jonathan Kew (:jfkthame) 2011-12-07 12:59:44 PST
No reason we shouldn't land it at the same time, I think - I'll post a patch shortly. It's pretty trivial to implement in the new model.
Comment 3 Jonathan Kew (:jfkthame) 2011-12-08 05:17:44 PST
Created attachment 580010 [details] [diff] [review]
observe memory-pressure notification and discard cached gfxShapedWord records.
Comment 6 Jonathan Kew (:jfkthame) 2012-01-13 02:04:53 PST
Created attachment 588347 [details] [diff] [review]
patch, v2 - observe memory-pressure notification and discard cached gfxShapedWord records

Well, that lit up the tree like it's still Christmas.

This patch passes try without complaint :) .... marking for re-review as it's somewhat restructured from the previous version.
Comment 8 Marco Bonardo [::mak] 2012-01-14 01:17:51 PST
https://hg.mozilla.org/mozilla-central/rev/6290daa65189

Note You need to log in before you can comment on or make changes to this bug.