PDA

View Full Version : Need help on memory management on an application using QWebView



shariqkhan
17th June 2011, 20:25
Hi,

I am developing an application on a target device. One module of the application involves the web browser which has been implemented using QWebView. Now the browser requires to be able to navigate back to at least 30 pages. So i keep a history of the web pages visited.
The problem is that after loading 5-6 webpages, the application dies because of low memory.
I searched the net and tried using

QAbstractNetworkCache::Clear()
QAbstractNetworkCache::remove()
QWebSettings::clearIconDatabase ()
QWebSettings::clearIconDatabase ()

These helped quite a bit, but the application still dies after loading approx 12-13 pages.
Since the target device has limited memory(40 MB) in our case, I need to free memory as soon as I am on threshold of running out of memory. Can somebody help me how can I free some memory and/or manage it better?

Thanks.

Santosh Reddy
17th June 2011, 23:36
Did you use these to limit the history...


QWebHistory * QWebPage::history (); // get the history instance
void QWebHistory::setMaximumItemCount ( int count ) // set maximum size

shariqkhan
17th June 2011, 23:46
yes..I did limit history size to 30.

Santosh Reddy
17th June 2011, 23:56
Just a thought: May be unload all the not required modules objects expect QWebView, (which you can created later after QWebView is done)..