[webkit-help] webkit memory optimization
thomas at cranksoftware.com
Thu Nov 19 19:13:55 PST 2009
luying pan wrote:
> Can someone read this post and help me understand it better?
> I'm having a lot of trouble understanding why webkit chews up so much
> memory. This blog post helped me somewhat, although not enough for me to
> dig into the code and do the optimizations myself.
> This guy's basically saying that the way webkit is mapping fonts is
> inefficient. So much that after their tweaks displaying google.com
> <http://google.com> dropped from using 30MB to only 4MB. That's a huge
> reduction in memory!
> I'm not sure if they're contributing this kind of changes back ... I
> doubt it since it certainly takes more than 4MB to display google.com
> <http://google.com> on the latest nightly builds.
Hi ... as the guy who wrote the post, one of the things to note is that
in this particular case, the WebKit code base was from OWB and not from
WebKit.org. The OWB port used freetype and fontconfig and at least some
of the tuning was related to that (and is discussed in that and subsequent
Additionally, the font cache available with today's builds (from either
site) was not available at the time we were doing that work, and some of
the work we did at the time has been superceded by the work done by both
WebKit.org and the OWB teams.
A final bit of tuning also has to occur at the OS platform level. In that
particular case, the work was being done on the QNX system, which as an
embedded real-time system provides much different (finer?) control over
a process' ability to return application heap memory back to the system
on free's (as well as munmap's, but that's less special).
Hope this clears things up a bit. We are actively working with some WebKit
customers on improvements we hope to trickle back into the tree.
Crank Software Inc.
More information about the webkit-help