[webkit-help] Memory leak?

Zongheng Zhou zongheng.zhou at gmail.com
Wed Jul 29 10:45:36 PDT 2009

Hi, all
I am using Qt 4.5.1, compiled using Sun CC 5.9 on Solaris 10. The binary
runs on Sparc machine. With the patch on
https://bugs.webkit.org/show_bug.cgi?id=24932 to make it compile.

I have written a simple testing program, which loads a web page. When the
page is loaded, it loads the page again. This continues till I press ctrl+c
to quit. It looks working fine for any URL I fed, till now I just realized
the memory leak issue...After it loads "www.cnn.com" consecutively for 800
times, the virtual memory usage reaches 1600M with resident memory 1500M
(When the program initiates, it's 130M and 100M, respectively). This leakage
also happens for many other URLs...

My program is quite simple:

class MyTest : public QObject
private slots:
    void onLoaded();
    QWebPage _page;
    int _count;

MyTest::MyTest() : _count(0)
    QUrl url("http://www.cnn.com");
    connect(&_page, SIGNAL(loadFinished(bool)), this, SLOT(onFinished()));

void MyTest::onFinished()
    fprintf(stderr, "Done round: %d\n", _count);
    QUrl url("http://www.cnn.com");

int main(int argc, char *argv[])
    QApplication app(argc, argv);

    QWebSettings *globalSetting = QWebSettings::globalSettings();
    globalSetting->setAttribute(QWebSettings::AutoLoadImages, false);
    globalSetting->setAttribute(QWebSettings::PluginsEnabled, false);

    MyTest * test = new MyTest();

    return app.exec();
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.webkit.org/pipermail/webkit-help/attachments/20090729/131bd944/attachment.html>

More information about the webkit-help mailing list