Why does Safari leak so much memory?

Discussion in 'Mac Apps and Mac App Store' started by Aika, Oct 27, 2006.

  1. Aika macrumors regular

    Aika

    Joined:
    Apr 7, 2006
    #1
    Safari takes up 500MB of ram (physical) quite frequently, requiring a reload of the application to stop my system getting any more sluggish. Camino never seems to exceed 100MB of ram (but sadly is a bit ropey when it comes to flash and wmv). Why can a small team get it right whilst Apple fail so miserably at optimising their software (iTunes is similarly bad when using coverflow view)? I like Safari enough to have paid for Saft and I love how fast it is at rendering pages but too often it brings my system to its knees.

    So yeah, I guess my main questions are:

    1) Has Safari 3.0 fixed the memory leaks?
    2) What causes such extreme leaks? Shoddy code?

    Ta :)
     
  2. DXoverDY macrumors 6502a

    Joined:
    Apr 19, 2005
    #2
    They aren't "leaks" per say. It caches the pages in ram... So that really just invalidates your other questions.
     
  3. pimentoLoaf macrumors 68000

    pimentoLoaf

    Joined:
    Dec 30, 2001
    Location:
    The SimCity Deli
    #3
    How much RAM do you have in your system? If it's 512mb, then Mail will have to use virtual memory (the sluggishness) to compensate.

    How much mail do you still have in your inbox or various folders? That can have an effect as well.
     
  4. darkwing macrumors 65816

    Joined:
    Jan 6, 2004
    #4
    Safari leaks memory because it's running instead of Firefox.
     
  5. Aika thread starter macrumors regular

    Aika

    Joined:
    Apr 7, 2006
    #5
    Is this a special feature no other browser uses? Like I said, no other browser uses more than about 100MB (Camino is using 46MB right now for me) whilst Safari uses five times that. If I quit and reopen Safari it will go from using 500MB to about 60MB (with the same tabs and all back and forwards functions present and correct courtesy of Saft) so if it's not a memory leak what is it?

    I have 2GB of ram so it's not my system that's the bottleneck.
     
  6. Catfish_Man macrumors 68030

    Catfish_Man

    Joined:
    Sep 13, 2001
    Location:
    Portland, OR
    #6
    Actually firefox is famous for gobbling ram as well.
    That said, there is a real reason, and it's not a good one. Safari's cache, prior to the code about two weeks ago, did not correctly cap its size. This should be fixed in the nightly builds of webkit, although there's still a few smaller leaks (as there are in basically all nontrivial software).
     
  7. DXoverDY macrumors 6502a

    Joined:
    Apr 19, 2005
    #7
    You don't understand. Leaks are memory you never get back until you restart. Not restart the app, but restart the OS.

    Your issue is not "leaked" memory. It's Safari's caching.
     
  8. Sayer macrumors 6502a

    Sayer

    Joined:
    Jan 4, 2002
    Location:
    Austin, TX
    #8
    Under the protected *virtual* memory space model, this is not true. Any memory "leaked" is unusable until the application is terminated, along with its virtual address space/pages.

    All of Mac OS X uses excessive caching to speed things up, such as menu drawing. You can see the effect *not* caching has in applications *cough* Adobe *cough* that build their menu from scratch every single time you open one, and how sluggish the app's menus can be.
     

Share This Page