Heap usage of QtWebKit

In this post I would like to share with you one of my latest memory consumption measurements about the heap usage of QtWebKit.
We have a nice extension for Valgrind called Freya which is capable of measuring used memory in per directory. So, I decided to make measurements about the distribution of memory consumption in JavaScriptCore and WebCore and publish the results about the peak memory usage and the overall memory usage.

Some details of the setup of my PC:
System: Slackware-Current
Hardware: Intel(R) Core(TM) i5 CPU 760@2.80GHz, 8Gb RAM
Tools: QtTestBrowser + Valgrind 3.7 + Freya
Qt5 hash: 754fb71efdbf5350b32a5cd9126af73a604f6032
WebKit: 0b96d270de50614048adc767e6c3c138d3dd5620 (SVN revision: 104796)
Benchmarks: Methanol with the first 19 sites from Alexa Top 500, Single page: youtube.com

Once again, Freya is a memory allocation tracker what is built upon Valgrind. You can read more about Freya in Zoltan Herczeg’s blogpost.

On the charts the Total memory usage means the summary of all allocated memory which is an aggregate number where only the alloc functions is counted.

First, let’s see the results of the peak memory consumption of JavaScriptCore directories. The x-axis shows the directories and the y-axis show the amount of used/peak memory in megabytes.

I think there are no unusual results amongst the peak memory consumption, every result looks okay and seems reasonable for me, so go on the details of the total allocated memory results.

WTF containers allocate the most memory, it seems correct, since we regularly use classes of Web Template Framework. Objects from bytecode directory use over 300 megabytes, while peak memory consumption of the directory is only 1.30 megabytes. It’s interesting... Probably it’s worth to check this deeper later. The total memory consumption of YARR is too high, since the peak memory usage is around only 200 kbytes. This also needs further investigation in the future.

Now, it's time to move forward and check out the big monster - WebCore and its directories.

Objects from the css directory allocate the most memory, more than the twice as the average of the other directories. Maybe there are some memory usage optimization possibilities in classes of css. The values of the other directories seem okay to me, nothing surprising.

The total memory consumption of WebCore shows that objects from platform directory consumes the most memory, css wins the second place and rendering is the third. The 280 megabytes consumption is more than a reason to investigate css directory further. Because of the same reason the platform and rendering directories should be evaluated as well. I hope the detailed results can point out good memory optimization candidates.

We run the Methanol test with 19 sites, this may raise a question in the reader: are these results relevant with a single-site running setup? I made another measurement for WebCore only, since nowadays WebCore's memory investigation is one of my main interest and task. I chose youtube.com, because it is part of the top25 sites of Alexa, furthermore it's included in Methanol benchmark suite.

The real interesting thing is the relation between the peak and total memory consumption, because the very big proportions are smelling bad for me. :)

As we can see, my statements are still relevant for a one-page run (css, platform, rendering). So now we can say that there can be something wrong in the examined modules because these modules show disproportionate values over the others. I will continue show my experiences in a new blog post with particular results about classes of subdirectories.

That’s all for today, see you soon!

freya_conf.txt24.71 KB

Anonymous (not verified) - 02/26/2012 - 16:15

It will be helpful if you post WebKit_conf.txt used for these measurements.

zoltan.horvath - 02/27/2012 - 14:50

I uploaded it. I hope it's helpful for you!

kuku (not verified) - 05/31/2013 - 10:46

Hello zoltan,
I tried freya for QtWebKit on ARM platform and got failure:
"ERROR = IRTemp use before def in IRExpr "...
Do you know how to fix it? thanks!

Post new comment

The content of this field is kept private and will not be shown publicly.
  • Web page addresses and e-mail addresses turn into links automatically.
  • No HTML tags allowed
  • Lines and paragraphs break automatically.

More information about formatting options

This question is for testing whether you are a human visitor and to prevent automated spam submissions.
Fill in the blank