[Qt-interest] QtWebKit and memory usage
Joel A. Iturra P.
tortuguero at gmail.com
Thu Feb 19 13:24:21 CET 2009
On Wed, Feb 18, 2009 at 7:51 PM, Rohan McGovern
<rohan.mcgovern at nokia.com> wrote:
> On Wednesday 18 February 2009, Joel A. Iturra P. wrote:
>> On Tue, Feb 17, 2009 at 8:06 PM, Rohan McGovern
>>
>> <rohan.mcgovern at nokia.com> wrote:
>> > On Wednesday 18 February 2009, Joel A. Iturra P. wrote:
>> >> [...]
>> >
>> > [...]
>> >
>>
>> If is not memory leak, how I can free memory ?
>
> I say it may not be a memory leak because I'm theorizing that memory
> would be reused if you were to reload the same webpage, or
> eventually reused if you reload the same webpage several times.
> That's why I asked the question about repeatedly reloading the same
> page.
>
> If repeatedly reloading the same page increases memory usage with no
> upper bound, it's a real leak. A tool like valgrind should be able
> to give more information.
I'm reloading the same page using setUrl(QUrl). I don't know how use valgrind,
but I'll try to learn today.
>
>> [...]
>> Any idea what I'm doing wrong ?
>
> You're not necessarily doing anything wrong, the QtWebkit API simply
> doesn't provide any way to make Webkit free memory used by its
> custom allocator(s).
>
> Also, how are you determining "memory usage"? (I should have asked
> this in my first mail).
using "top" on my Debian Linux
This view is few minutes after start
Mem: 2006812k total, 908100k used, 1098712k free, 20780k buffers
Swap: 1943824k total, 0k used, 1943824k free, 419548k cached
PID USER PR NI VIRT RES SHR S %CPU %MEM TIME+ COMMAND
7036 jiturra 20 0 135m 93m 19m S 77 4.8 0:21.85 tmp
15 minutes after
Mem: 2006812k total, 1957124k used, 49688k free, 776k buffers
Swap: 1943824k total, 305040k used, 1638784k free, 125080k cached
PID USER PR NI VIRT RES SHR S %CPU %MEM TIME+ COMMAND
7036 jiturra 20 0 1270m 1.1g 19m R 77 57.1 7:08.45 tmp
I will try with QWebFrame::load(QUrl), It seems a better method.
Thanks.
--
Joel A. Iturra
Santiago - Chile
More information about the Qt-interest-old
mailing list