What is happening with the memory consumption of WebKit on 64 bit?

64 bit systems allow allocating more memory, but this extra space has a trade-of: the pointers are grown to 64 bit wide which increases the total memory consumption. Ever wondered about the price of 64 bit? Well, you can find comparisons here about some popular pages on the Qt port of WebKit. Furthermore, we offer some CSS subsystem related comparisons at the end of the post.

Profiling memory consumption is difficult, since most tools just collect a huge amount of unordered data, throw it on you, and be happy. This was motivated me to create a new tool for valgrind called Freya. This tool offered a way to better organize the results. Unfortunately it was not updated for a long time. Now that valgrind 3.6.1 is out, I decided to continue the project: move to the latest valgrind and fix all known bugs (thanks for reporting them).

The measurement performed on a machine which has both 32 and 64 bit environments of the same Linux distribution. The configuration file for Freya is in the attachments section. Since the numbers are peak memory consumptions, the total is not necessary equal to the sum of the sub-totals. It is usually lower. Enough talk now, here are the numbers:

Let's start with www.google.com on a 32 | 64 bit system.
Total: 5.0Mb | 7.5Mb

    Libs: 1.8Mb | 3.2Mb
      ld: 1.7Mb | 3.0Mb

    WebKit: 1.7Mb | 2.4Mb

      JavaScriptCore: 1.1Mb | 1.6Mb
      Loader: 291.2Kb | 312.5Kb
      Other: 161.1Kb | 233.7Kb
      CSS-all: 152.1Kb | 216.5Kb
        CSS: 130.1Kb | 169.4Kb
        CSS-parser: 54.3Kb | 74.5Kb

      Page: 109.0Kb | 181.4Kb
      Rendering: 38.6Kb | 67.3Kb

    Qt: 1.4Mb | 1.8Mb

      QtGui: 1.0Mb | 1.2Mb
      QtCore: 760.2Kb | 904.4Kb
      QtOther: 22.0Kb | 36.0Kb

    Other: 227.5Kb | 291.0Kb

Let's continue with www.facebook.com on a 32 | 64 bit system.

Total: 9.7Mb | 12.5Mb

    Qt: 5.6Mb | 6.1Mb
      QtGui: 4.6Mb | 4.8Mb
      QtCore: 1.2Mb | 1.4Mb
      QtOther: 20.2Kb | 56.7Kb

    WebKit: 3.4Mb | 4.8Mb

      JavaScriptCore: 1.9Mb | 2.8Mb
      Loader: 737.4Kb | 778.1Kb
      CSS-all: 686.1Kb | 1.0Mb
        CSS: 513.5Kb
        CSS-parser: 257.6Kb

      Page: 246.5Kb | 415.1Kb
      Other: 153.9Kb | 220.1Kb
      Rendering: 69.9Kb | 109.8Kb

    Libs: 1.8Mb | 3.2Mb

      ld: 1.6Mb | 3.0Mb

    Other: 348.2Kb | 401.3Kb

The next one is www.bbc.co.uk on a 32 | 64 bit system. More color-ful
Total: 19.2Mb | 24.8Mb

    WebKit: 9.5Mb | 13.0Mb
      JavaScriptCore: 6.2Mb | 8.2Mb
      Loader: 1.4Mb | 1.6Mb
      CSS-all: 874.5Kb | 1.2Mb
        CSS: 674.0Kb | 957.1Kb
        CSS-parser: 283.2Kb | 455.8Kb

      Page: 786.8Kb | 1.3Mb
      Rendering: 403.0Kb | 655.4Kb
      Other: 380.6Kb | 462.2Kb

    Qt: 7.5Mb | 8.2Mb

      QtGui: 5.4Mb | 5.7Mb
      QtCore: 1.9Mb | 2.1Mb
      QtOther: 547.8Kb | 585.7Kb

    Libs: 1.8Mb | 3.2Mb

      ld: 1.7Mb | 3.0Mb

    Other: 536.9Kb | 642.8Kb

Git manual (http://www.kernel.org/pub/software/scm/git/docs/user-manual.html) on a 32 | 64 bit system.
Total: 6.8Mb | 10.4Mb

    WebKit: 3.3Mb | 5.0Mb
      Rendering: 1.3Mb | 2.2Mb
      Page: 1.0Mb | 1.6Mb
      CSS-all: 463.0Kb | 611.8Kb
        CSS: 431.8Kb | 553.2Kb
        CSS-parser: 54.3Kb | 74.5Kb

      Loader: 359.3Kb | 332.5Kb
      Other: 95.9Kb | 149.2Kb
      JavaScriptCore: 23.3Kb | 27.7Kb

    Libs: 1.8Mb | 3.2Mb

      ld: 1.7Mb | 3.0Mb

    Qt: 1.5Mb | 1.9Mb

      QtGui: 1.0Mb | 1.2Mb
      QtCore: 927.6Kb | 1.1Mb

    Other: 232.7Kb | 309.8Kb

The Last one is us.battle.net/sc2 on a 32 | 64 bit system. This page is really eye-candy.
Total: 25.3Mb | 28.1Mb

    Qt: 20.8Mb | 21.1Mb
      QtGui: 19.7Mb | 19.9Mb
      QtOther: 1.8Mb | 1.8Mb (libqjpeg: 1.7Mb on both)
      QtCore: 1.7Mb | 2.0Mb

    WebKit: 7.5Mb | 9.5Mb

      JavaScriptCore: 4.3Mb | 5.5Mb
      Loader: 1.4Mb | 1.5Mb
      Other: 1.2Mb | 1.2Mb
      CSS-all: 692.7Kb | 1.0Mb
        CSS: 530.8Kb | 744.6Kb
        CSS-parser: 103.5Kb | 342.2Kb

      Page: 298.6Kb | 488.5Kb
      Rendering: 142.0Kb | 234.7Kb

    Libs: 1.9Mb | 3.2Mb

      ld: 1.7Mb | 3.0Mb

    Other: 395.8Kb | 516.2Kb

We thought before that the CSS plays a bigger role in the memory consumption, but it seems the opposite is true. The major player is JavaScriptCore with its ExecutableAllocator and garbage collected areas. Naturally images can consumes a huge amount of memory, but this depends on the page.

WebKit_conf.txt1.59 KB

Aidan Van Dyk (not verified) - 04/04/2011 - 18:58

Hm.. Javascript is the worst culprit... And then visit in gmail ;-(

zoltan.herczeg - 04/05/2011 - 09:45

Yeah. The garbage collected and executable memory area is oversized to squeeze out as much performance as possible.

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