Uploaded image for project: 'Qt'
  1. Qt
  2. QTBUG-29620

QtWebkit based browsers (demo browser & arora) slow down (high kernel IO is experienced) over time while browsing and eventually crash on embedded MIPS platform without swap.

    XMLWordPrintable

Details

    • Bug
    • Resolution: Won't Do
    • P4: Low
    • None
    • 4.8.3
    • WebKit
    • None
    • CPU: MIPS 24k
      RAM: 128 MB (~28MB allocated by system & initramfs)
      Linux Kernel: 2.6.22.19
      QT: 4.7.0
      DirectFB 1.0

    Description

      After some time (a few minutes) typical web browsing, browser application (QtWebKit based browser - both demo browser and arora) starts to experience significant slowdown in responsiveness, page loading and rendering speed. Eventually application will be killed by Kernel because of out of memory. First clue was found using top application which showed high kernel IO usage (90 - 100%). That led to tweaking all caches we could find in WebKit engine either decreasing or completely disabling them using following function calls or setting variable values:

      //netflix-qt/src/src/3rdparty/webkit/WebKit/qt/Api/qwebsettings.cpp:
      QWebSettings::setMaximumPagesInCache(0);
      QWebSettings::setObjectCacheCapacities(0, 0, 0);
      QWebSettings::setOfflineStorageDefaultQuota(0);
      QWebSettings::setOfflineWebApplicationCacheQuota(0);
      WebCore::cache()->setDisabled(true);

      //netflix-qt/src/src/gui/image/qpixmapcache.cpp:
      QPixmapCache::setCacheLimit(1024); //for embedded systems default is 2048

      //netflix-qt/src/src/network/access/qnetworkreply.cpp:
      QNetworkReplyPrivate::QNetworkReplyPrivate(): readBufferMaxSize(32768) // default is 0 which means unlimited

      //netflix-qt/src/src/3rdparty/webkit/WebCore/loader/Cache.cpp:
      static const int cDefaultCacheCapacity = 512 * 1024; // changed from default value: 8192 * 1024

      After that, repetitive function calls:

      //netflix-qt/src/src/3rdparty/webkit/WebKit/qt/Api/qwebsettings.cpp:
      QWebSettings::dumpStats();

      showed that there are no cached resources. Still, slowdown and high kernel IO are being experienced.

      Reading blog article The effect of TCmalloc in the QtWebKit port - stage 2: Memory consumption led us to disabling TCmalloc allocator and falling back to default system malloc:

      // Platform.h
      #define USE_SYSTEM_MALLOC 1

      which again, didn't resolve issues.

      Since our system doesn't have swap, final and again unsuccessful attempt was made tuning Linux system parameter:

      echo 0 > /proc/sys/vm/swappiness

      Our conclusion is that this could be Qt related problem since running Android and its WebKit based browser on exactly the same HW platform doesn't have these issues at all.

      System log is attached.

      Attachments

        No reviews matched the request. Check your Options in the drop-down menu of this sections header.

        Activity

          People

            chramos chramos
            miroslav_ristic@sdesigns.com Miroslav Ristic
            Votes:
            3 Vote for this issue
            Watchers:
            8 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved:

              Gerrit Reviews

                There are no open Gerrit changes