[webkit-dev] Purging as much memory as possible

Peter Kasting pkasting at google.com
Thu Oct 1 18:24:22 PDT 2009


In Chromium, we have various events that we'd like to respond to by freeing
as much memory as possible.  (One example is system sleep, where we'd like
to dump memory before sleeping to avoid having to page it back in after
waking.)

I'm trying to find what areas in WebCore are good candidates for this kind
of work.  So far I've found WebCore::Cache, which is a singleton per
process, on which I can call setCapacity(..., ..., 0) to try and flush as
much as possible.

It's also been suggested to me that the Glyph cache is a good candidate; I
haven't quite figured out how this works, although I have found mitz'
recently-added showGlyphPageTree() function that I can probably use to do
some investigation.

My questions are:
* I notice that even when I set the WebCore::Cache capacity to zero, I can't
necessarily dump _everything_ out of it.  Is there some other set of calls I
should make to drop more references somewhere?
* Does anyone already know the likely footprint of the Glyph cache, or how
to clear it?
* Are there other obvious places to look?  Certainly the JS engine can hold
a lot of memory, but that's outside the scope of this question; I'm just
looking in WebCore.  Any other caches I can dump?

Thanks,
PK
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.webkit.org/pipermail/webkit-dev/attachments/20091001/1a35c891/attachment.html>


More information about the webkit-dev mailing list