Detailed memory consumption of some popular sites. Poor good old malloc, everyone's beast of burden.

It is time to try out my new freya tool. Only some web-sites and a fresh Qt (4.6.0) and QtWebKit (r51481) are needed. The values are peak memory consumptions, which is not necessary the best choice (since the sum of their total value is greater than the peak memory consumption), but at least we can see the memory hungry parts of QtWebKit.

Note: The numbers are depending on the grouping rules. I tried to improve them as far as I could, but I feel there is still room for improvement. For example, it would be interesting to see the total memory consumption of image handling, but it is scattered through many files in many directories.

http://www.google.com

Total: 3.8Mb

    libs: 1.7Mb
      ld: 1.1Mb
      libfreetype: 293.4Kb

    Qt: 1.1Mb

      Qt-gui: 965.1Kb
        QFreetypeFace::getFace (qfontengine_ft.cpp:238) 669.8Kb
        QX11PixmapData::fromImage (qpixmap_x11.cpp:648) 118.5Kb

      Qt-corelib: 312.5Kb

        locale_encode (qfile.cpp:66) 98.0Kb

      Qt-network: 125.7Kb

    WebKit: 1.0Mb

      JavaScriptCore: 580.6Kb
        JSC::Heap::allocateBlock (Collector.cpp:259) 256.0Kb
        JSC::Identifier::add (Identifier.cpp:54) 42.7Kb

      WebCore-other: 307.7Kb

        WebCore::TextResourceDecoder::decode (TextResourceDecoder.cpp:818) 94.8Kb

      WebCore-page: 92.9Kb
      WebCore-css: 76.5Kb
      WebCore-rendering: 23.7Kb

http://www.bbc.co.uk

Total: 10.2Mb

    WebKit: 4.4Mb
      WebCore-other: 1.8Mb
        WebCore::TextResourceDecoder::decode (TextResourceDecoder.cpp:818) 911.7Kb
        WebCore::TextResourceDecoder::decode (TextResourceDecoder.cpp:826) 398.4Kb
        WebCore::ResourceLoader::addData (ResourceLoader.cpp:185) 390.1Kb

      JavaScriptCore: 1.6Mb

        JSC::Heap::allocateBlock (Collector.cpp:259) 512.0Kb
        JSC::BytecodeGenerator::generate (BytecodeGenerator.cpp:163) 184.2Kb
        JSC::Identifier::add (Identifier.cpp:54) 116.4Kb

      WebCore-page: 563.4Kb

        WebCore::EventTarget::addEventListener (EventTarget.cpp:175) 145.0Kb
        WebCore::HTMLTokenizer::enlargeScriptBuffer (HTMLTokenizer.cpp:1996) 117.7Kb

      WebCore-rendering: 434.0Kb

        WebCore::RenderBlock::layoutInlineChildren (RenderBlockLineLayout.cpp:858) 258.3Kb

      WebCore-css: 415.4Kb

        WebCore::CSSParser::setupParser (CSSParser.cpp:224) 132.8Kb

    Qt: 4.4Mb

      Qt-gui: 3.3Mb
        QFreetypeFace::getFace (qfontengine_ft.cpp:238) 2.0Mb
        QImageData::create (qimage.cpp:242) 808.9Kb

      Qt-corelib: 637.6Kb

        QIODevice::read (qiodevice.cpp:943) 352.0Kb

      Qt-network: 567.7Kb
      Qt-other: 199.5Kb

        QGifHandler::QGifHandler (qgifhandler.cpp:752) 193.1Kb

    libs: 2.0Mb

http://maps.google.com

Total: 9.0Mb

    WebKit: 6.1Mb
      JavaScriptCore: 3.9Mb
        JSC::Heap::allocateBlock (Collector.cpp:259) 1024.0Kb
        JSC::BytecodeGenerator::generate (BytecodeGenerator.cpp:163) 620.8Kb
        JSC::ParserArena::allocateFreeablePool (390.6Kb) ParserArena.cpp:104
        JSC::Identifier::add (Identifier.cpp:54) 281.8Kb

      WebCore-other: 2.3Mb

        WebCore::TextResourceDecoder::decode (TextResourceDecoder.cpp:818) 1.5Mb
        WebCore::SharedBuffer::SharedBuffer (SharedBuffer.cpp:39) 274.5Kb

      WebCore-page: 603.6Kb

        WebCore::HTMLTokenizer::enlargeScriptBuffer (HTMLTokenizer.cpp:1996) 160.6Kb

      WebCore-css: 302.8Kb

        WebCore::CSSParser::setupParser (CSSParser.cpp:199) 80.4Kb

      WebCore-rendering: 148.5Kb

    libs: 1.9Mb
    Qt: 1.4Mb

      Qt-gui: 1.1Mb
        QFreetypeFace::getFace (qfontengine_ft.cpp:238) 669.8Kb
        QX11PixmapData::fromImage (qpixmap_x11.cpp:648) 256.0Kb

      Qt-corelib: 367.8Kb

        locale_encode (qfile.cpp:66) 98.1Kb

      Qt-network: 209.9Kb

http://sourceforge.net

Total: 18.3Mb

    libs: 9.8Mb
      XGetImage (libX11.so.6.2.0) 4.0Mb
      libxcb.so.1.0.0 3.9Mb
      Both of them called from: QX11PixmapData::toImage (qpixmap_x11.cpp:1475)

    Qt: 9.1Mb

      Qt-gui: 8.5Mb
        QX11PixmapData::fromImage (qpixmap_x11.cpp:648) 6.2Mb
        QImageData::create (qimage.cpp:242) 5.3Mb

      Qt-corelib: 679.9Kb

        QIODevice::read (qiodevice.cpp:943) 320.0Kb

      Qt-network: 423.6Kb
      Qt-other: 97.1Kb

    WebKit: 7.5Mb

      JavaScriptCore: 3.5Mb
        JSC::Heap::allocateBlock (Collector.cpp:259) 1024.0Kb
        JSC::Structure::copyPropertyTable (Structure.cpp:647) 422.0Kb
        JSC::BytecodeGenerator::generate (BytecodeGenerator.cpp:163) 374.0Kb
        JSC::Interpreter::execute (Interpreter.cpp:681) 316.5Kb

      WebCore-other: 3.4Mb

        WebCore::TextResourceDecoder::decode (TextResourceDecoder.cpp:818) 1.9Mb
        WebCore::CachedScriptSourceProvider::length (CachedScriptSourceProvider.h:48) 687.9Kb
        WebCore::CachedScriptSourceProvider::data (CachedScriptSourceProvider.h:47) 657.5Kb

      WebCore-page: 969.7Kb

        WebCore::EventTarget::addEventListener (EventTarget.cpp:175) 240.0Kb
        WebCore::HTMLTokenizer::enlargeScriptBuffer (HTMLTokenizer.cpp:1996) 232.3Kb

      WebCore-css: 514.5Kb

        WebCore::CSSParser::setupParser (CSSParser.cpp:224) 159.0Kb

      WebCore-rendering: 222.0Kb

www.facebook.com

Total: 11.7Mb

    Qt: 6.9Mb
      Qt-gui: 6.6Mb
        QImageData::create (qimage.cpp:242) 2.9Mb
        QFreetypeFace::getFace (qfontengine_ft.cpp:238) 2.0Mb
        QX11PixmapData::fromImage (qpixmap_x11.cpp:648) 1.8Mb

      Qt-corelib: 436.5Kb

        QIODevice::read (qiodevice.cpp:932) 155.2Kb
        QIODevice::read (qiodevice.cpp:943) 128.0Kb

      Qt-network: 384.2Kb

        QHttpNetworkReplyPrivate::gunzipBodyPartially (qhttpnetworkreply.cpp:402) 341.2Kb

      Qt-other: 69.8Kb

    WebKit: 4.1Mb

      WebCore-other: 2.2Mb
        WebCore::TextResourceDecoder::decode (TextResourceDecoder.cpp:818) 2.2Mb
        WebCore::SharedBuffer::SharedBuffer (SharedBuffer.cpp:39) 764.4Kb

      JavaScriptCore: 1.6Mb

        JSC::Heap::allocateBlock (Collector.cpp:259) 512.0Kb
        JSC::Identifier::add (Identifier.cpp:54) 218.5Kb

      WebCore-css: 638.0Kb

        cssyyparse (CSSGrammar.y:798) 171.7Kb

      WebCore-page: 254.1Kb
      WebCore-rendering: 44.7Kb

    libs: 1.8Mb

Side story:

During the measurement, the guys here replaced my Qt 4.5.2 to 4.6.0. (Caused me a lot of trouble... grrr) However, it turns out that the memory consumption of Qt 4.6.0 improved a lot compared to 4.5.2 (especially the network and gif handling).

www.google.com: 2.5Mb decreased to 1.1Mb in 4.6.0 (Total: 3.8Mb from 5.6Mb)
www.bbc.co.uk: 6.5Mb decreased to 4.4Mb (Total: 10.2Mb from 12.9Mb)

The freya configuration file is attached to this post.

AttachmentSize
WebKit_conf.txt1.32 KB

lu_zero (not verified) - 12/09/2009 - 08:06

Freya itself looks impressive and the webkit results are nice as well, have you considered having it included in valgrind?

PS: your captcha isn't human parsable...

Arturo (not verified) - 08/18/2010 - 18:38

Isn't it value "Leak" (alloc - dealloc) probably the best value to look for memory consumption? Instead of leak, naming it may help to call something like UsedMem and call fr_sort_and_dump at regular intervals to see the memory usage.

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

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