[webkit-help] [webkit-dev] Regarding cache memory leaks

Zaheer Ahmad zaheer.mot at gmail.com
Wed Oct 20 23:50:20 PDT 2010


On Wed, Oct 20, 2010 at 6:26 PM, <sumanrapolu at aim.com> wrote:

>
>    Hi Holger,
>
> Thank you for your valuable suggestions. We have tried the 2 solutions
> which you have proposed:
>
>    1. *Verify that you are not leaking memory. Create a sample page,
>    reload it in a loop, repaint it and see what happens to your memory..*
>
>    We have tested with attached sample page(memtest.html) by reloading
>    with Webkit default cache model ( WEBKIT_CACHE_MODEL_WEB_BROWSER ) then we
>    observed no memory leaks. When we set the webkit cache model to
>    WEBKIT_CACHE_MODEL_DOCUMENT_VIEWER then observed leak for every reload. (
>    the leak is image size equivalent for every reload )
>
> can you try this in the latest trunk with a standard port (e.g. GTK)?

>
>    1.
>    2. *Ask the VM to overcommit the memory, and see how far you can push
>    things...*
>
>    We are using 2.6.22.19-19 so we are unable to set the overcommit flag
>    from /proc file system.
>    $echo 2 > /proc/sys/vm/overcommit_memory (strict overcommit) -- When we
>    set like this, the browser is crashing.
>
> As per previous comments from Webkit-dev mailing list, we understood that
> the cache limit is only applied for other than current page. In that case,
> how can we set cache limit for current page.
>
There is no current mechanism where you can set X amount of memory and the
browser will be in that limits. The current page will take memory what ever
it needs.

>
> We have also tried with the below mentioned approach and observed some
> memory regain:
>
>    1. Opened the attached Picasa sample html page and running in slideshow
>    mode.
>    2. Displayed almost 100 random images, which consumed almost 80% of
>    RAM.
>
> Ideally only the images in the visible area are required to be decoded and
in memory. I think the default implementation will not release resources
once decoded for the current page, may be something you could try to do
based on the memory availability on the system and the memory already used
by the current page.

>
>    1. At this condition, we redirected to another web page (google.com).
>    Due to this RAM free memory is regained approximately 10MB, but not the
>    entire consumed memory used by previous loaded page (i.e. Picasa page)
>
> Thats the behavior of allocator, it will not give back memory aggressively
to the system, but does free it. you can try your page -> blank page -> your
page multiple times, and you should not see a bloat.

>
>    1. After this, we dropped the kernel cache by using below command and
>    observed around 4MB memory gain.
>    $echo 3 > /proc/sys/vm/drop_caches
>
> Could you please suggest is there any way to strictly limit the cache size
> for current page. Even though when we call removeLRUList,
> pruneLiveResources() the cachedResource references are not freeing. How can
> we properly remove these cachedResource references.
>
> Thanks,
> Suman
>
> -----Original Message-----
> From: Holger Freyther <zecke at selfish.org>
> To: sumanrapolu <sumanrapolu at aim.com>
> Cc: webkit-dev <webkit-dev at lists.webkit.org>
> Sent: Tue, 19 Oct 2010 12:48 am
> Subject: Re: Regarding cache memory leaks
>
>  On 10/18/2010 02:55 PM, sumanrapolu at aim.com wrote:
>
>
>
> > Hi Holger,
>
>
>
>
>
>
> Hi,
>
>
>
> (please keep the mailinglist in the loop)
>
>
>
>
>
>
> > We have applied the
>
>
>
> > patch(https://bug-44806-attachments.webkit.org/attachment.cgi?id=68154) to
>
>
>
> > remove the "deadResources", which is working fine. Because of this patch the
>
>
>
> > duration to consume the entire available RAM has increased. But still the
>
>
>
> > "liveResources" are not freeing, due to which its again consuming the entire
>
>
>
> > available RAM.
>
>
>
>
>
>
> my time is limited right now so I can not help you in my spare time. But if
>
>
>
> the encoded data of the current page is more than fits into your RAM there is
>
>
>
> not much you can do, you can either wait to get killed by the kernel, or you
>
>
>
> can stop loading the page. Just imagine you would throw away images you have
>
>
>
> already downloaded, you would need to download them again.. in most cases
>
>
>
> where you have limited RAM you also have limited bandwidth...
>
>
>
>
>
>
> The two things that I can propose are:
>
>
>
> 	a) verify thay you are not leaking memory. Create a simple page, reload it in
>
>
>
> a loop, repaint it and see what happens to your memory...
>
>
>
> 	b) ask the Linux VM to overcommit memory and see how far you can push things.
>
>
>
>
>
>
>
>
>
> I just can't commit more of my spare time to look into memory usage of
>
>
>
> WebCore, I wish I could spend more time on WebKit...
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
> _______________________________________________
> webkit-dev mailing list
> webkit-dev at lists.webkit.org
> http://lists.webkit.org/mailman/listinfo.cgi/webkit-dev
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.webkit.org/pipermail/webkit-help/attachments/20101021/1a4f05ad/attachment-0001.html>


More information about the webkit-help mailing list