I realize this topic is very old, but I came across this problem today and managed to figure out a work-around.
The
QWebSettings::setMaximumPagesInCache(0)
QWebSettings::setObjectCacheCapacities(0,0,0)
had absolutely no effect on the memory leak under Windows 10 and MAC OS X 10.
After reading the post above, about the QWebView's caching mechanism and memory usage, I looked for more information and came across this article: https://webkit.org/blog/516/webkit-page-cache-ii-the-unload-event/
Something caught my attention - "unload event handlers, prevent pages from going into the Page Cache". Ding, ding, ding... :)
So I decided to try and manually add an unload event handler to the source of each page that is loaded and see what happens.
So after the page loading is complete, I do:
QWebElement body=myWebView->page()->mainFrame()->findFirstElement("body");
body.setAttribute("onunload","myFunction()");
Just these two lines stopped a 1MB to 3MB memory leak per page loaded in my case. :)
I'm also doing:
QWebSettings::clearMemoryCaches();
webView->history()->clear();
before loading each page (because I don't need them).
I hope this work-around will be helpful to other people who may stumble upon this problem in the future.