Menu

#118 Webkit Memory Leak ?

Accepted
None
High
Defect
2017-11-24
2017-11-21
No

I use the latest "WebKit-604.4.5-Leopard-PowerPC.dmg" on a G4 Cube (!), running OS X 10.5.8.
Webkit works fine when initialy started.
But very quickly it saturates the available memory (1.5GB) and when it reaches this limit, Webkit crawls down to a snail.
Closing Webkit windows and tabs does not help.
Only restarting Webkit helps... for a few minutes, until the problem starts again.
The problem seem to be much worse with multiple tabs, and minimized when only a single window / single tab is used.
Let me know what kind of additional information I can provide to help solve this annoying ssue.

Discussion

  • Tobias Netzel

    Tobias Netzel - 2017-11-22
    • status: New --> Accepted
    • assigned_to: Tobias Netzel
    • Type: Review --> Defect
     
  • Tobias Netzel

    Tobias Netzel - 2017-11-22

    Would be absolutely great if you could provide steps for reproducing it that quickly!
    I've seen this happen quite frequently but I don't know how to reproduce it - the browser uses to run rather well for quite some days. But if you could tell me a trick to quickly force this I'hopefully be able to finally find and fix the issue!
    Please tell me what sites you're visiting and whether you are using Safari extensions like ad blockers or Safari hacks like Glims (which I've been using for several years).
    I know that complex flash content will very reliably shoot down your browser within a short time. And ad blocker extensions are very resource hungry, too - and lighter and faster alternatives are available.

    Futhermore you could test whether Roccat (relinked to Leopard WebKit) exposes the same issue for you.

     

    Last edit: Tobias Netzel 2017-11-22
  • Jean-Jacques GUILLEMAUD

    I just checked, and "Roccat LepWK.app" [relinked with WebKit-604.4.5-Leopard-PowerPC.dmg] has the same problem : memory is not freed when you close Tabs, and you have to restart the browser to free it.
    Roccat.app [NOT-LepWK] has a much slower memory growth.

     
    • Tobias Netzel

      Tobias Netzel - 2017-11-23

      Just for providing some background information: WebKit doesn't immediately free memory when closing tabs or windows because it keeps the "pages" in its page cache. A certain number of pages are always kept in that cache; if I remember correctly Roccat sets a smaller page cache size than Safari.
      So the observed behaviour is to be expected - to some extent.

       
  • Tobias Netzel

    Tobias Netzel - 2017-11-23

    I just gave it a try by doing that search on ebay in the Safari session that I've been using since yesterday.
    I used the command line developer tool 'vmmaps' for examining Safari's memory usage.
    Before opening those ebay pages the following summarized values were determined:

    Writable regions: Total=1.4G written=822.3M(59%) resident=956.0M(69%) swapped_out=9856K(1%) unallocated=428.7M(31%)
    

    After opening and fully loading those pages the values were like this:

    Writable regions: Total=1.4G written=836.9M(60%) resident=966.3M(69%) swapped_out=6204K(0%) unallocated=431.0M(31%)
    

    And after closing all the newly opened tabs:

    Writable regions: Total=1.3G written=731.0M(57%) resident=861.1M(67%) swapped_out=5928K(0%) unallocated=430.9M(33%)
    

    So while the memory usage increased for opening the ebay pages, it was even lower than initially after closing again all of them.

    So appearantly all caching mechanisms work like they should - I wouldn't have expected these quite good results. But there ARE some cases where memory usage rapdly increases without decreasing later on. I'll further investigate...

    Do you get the same results with extensions disabled?

    Instead of Adblock Plus I'd recommend Privoxy - although it might not be as easy to use as Adblock Plus.
    Instead of SafariRestore I'd recommend using Glims for Safari.
    In my experience ClickToFlash/ClickToPlugin aren't that useful any longer. Since quite some months I'm browing without them - and they shouldn't be used on youtube any longer since they force loading the flash versions of the videos in order to being able to replace them.
    See [Home] (at the bottom) for recommended extensions and add-ons.

     

    Related

    Wiki: Home

  • Jean-Jacques GUILLEMAUD

    I uninstalled and disabled ALL extensions; I kept all previous plug-ins active.
    The memory growth is quite slower, and I need to open about 12-15 ebay Tabs to reach the same memory usage as before.
    BUT when I close all those Tabs, the memory is again NOT released, neither the "Active" nor "Inactive/Cached" part.
    I tried to close the last Tab/Window, but then Webkit hanged on, and I had to force quit.

    Would it help if I could install your 'vmmaps' tool ? But if it just gives the pages total and does not trace what procedure uploads what, then I suspect it won't help much...

    I am sorry my "quick way for reproducing the problem" is not so reproduceable on your side.
    I know memory leaks are quite a pain to eradicate, especially when it is not even obvious if it is a 10.5.8, Safari 5.0.6 or WebKit issue. At least we know it is not an Extension issue, although Extensions make it worse, and it does not seem to be a Safari 5.0.6 issue since Roccat LepWK has the same problem.

     
    • Tobias Netzel

      Tobias Netzel - 2017-11-24

      'vmmap' provides a lot of information - those lines are the most summarized output from it.
      It is actually possible to log all memory allocations by sourcecode line - but it needs some GB of free RAM for not taking the whole night (constantly swapping memory between the hard drive and RAM). So using those tools would only be possible on a PowerMac G5 - which I don't own.

       
  • Jean-Jacques GUILLEMAUD

    For the sake of completeness, I also disabled ALL Plug-Ins in addition to disabling ALL Extensions.
    No difference : the WebKit Active and Inactive memory is not released unless I quit WebKit

     

Log in to post a comment.

Want the latest updates on software, tech news, and AI?
Get latest updates about software, tech news, and AI from SourceForge directly in your inbox once a month.