Important: Please read the Qt Code of Conduct -

QWebView memory deallocation

  • Hello all!

    I'm building application which constantly creates a deletes QWebView object. After some time the memory consumption is growing significantly. I build the minimal example, which demonstrates the problem.

    @ QList<QWebView *>views;

    for(int i = 0;i<500;i++)
        QWebView *view = new QWebView();
    foreach(QWebView *view,views)
        delete view;

    If I run this function in a loop memory allocated by programm gets evenly growing. If I replace QWebView with QPlainTextEdit or other widget - problem disappears. I also tried functions like clearMemoryCaches, setObjectCacheCapacities, deleting page. Still no luck. Is there is a correct way how resources from QWebView can be deallocated?

Log in to reply