Hi All, I noticed that my Safari is consuming a minimum of 200MB everytime i use it as a browser and sometimes reach 500MB at its peak. Now 500MB is quite big already for a 2GB RAM machine. I've now shifted to Mozilla, which also has its own share of memory leak but not as bad as Safari! My question would be: i love to use Safari, but i hate its memory leak issue. I want to ask if anyone is aware of any configuration that would resolve its issue? i can't find any application that might be able to handle garbage collection etc... Thanks
I'm running Safari now and Activity Monitor (/Utility/Activity Monitor) shows that Safari is using 89 Mb of Real Memory and 900 Mb of VIrtual. Right now, I have 4 tabs active - AOL, PhilMUG, GMail and Google Reader. I opened a fifth one, YouTube and run a random video - Real Memory is up 113 Mb and Virtual, 931 Mb. Plug-ins, Java and JavaScript are all enabled. I closed the YouTube tab and the memory consumption parameters are still both up (actually increased a bit in fact). I guess that's memory leak… FYI, I'm using Safari 3.1, the buggiest Safari iteration to date. EDIT: I'm shut down Safari and running Firefox 2.0.0.13 now for an unofficial comparo - same tabs, same video. Real - 105 Mb Virtual - 933 Mb I closed three tabs and the memory usage didn't change much either, although it's lower than that consumed by Safari (even if I have the same plug-ins plus a few more Firefox-specific Add-Ons).
don't you think it's possible that the leopard 'janitor' (the os x memory cleanup function) is causing the problem, since both safari and firefox did not 'release' memory after they had closed? most of the time, the app that exhibits the symptom is not the app that caused the problem.
well if Safari did not release the memory that it was supposed to let go, then as a 1st level interface, it is already at fault. Mozilla itself has acknowledged that it has this kind of issue. anyway, until safari fixes the problem, i'll stick with mozilla
can you point me to where mozilla admitted this memory issue? i would like to read it myself. thanks.
Guys, this is a common performance technique browsers use - they cache the last few pages in memory so that if you access the page again, the page is retrieved from memory instead of re-downloading it again from the web. If you close the tab, the page stays in memory for a while so you don't immediately see the cleanup in activity monitor. When I say "memory", I'm referring to actual RAM and virtual memory (hard disk caching). Applications normally don't have control when their in-memory RAM data is cached to disk. OS X does this on their behalf transparently.
Not so serious (IF it's Safari indeed that's causing the memory leak) really, unless you're running several memory-hogging apps. You may run low on physical memory and thus, apps may slow down.
excellent explanation lamski. thanks. from wikipedia : a memory leak has similar symptoms to a number of other problems, and generally can only be diagnosed by a programmer with access to the program source code; however many people are quick to describe any unwanted increase in memory usage as a memory leak, even if this is not strictly accurate. (boldface mine)
Point well taken. Perhaps an expert programmer here at PhilMUG may want to share his views on the matter?
This could be simply how OS X manages its memory. I have no access to any source code, so this will be a simple analysis. OS X seems to be generous when allocating Real memory to applications. After a few hours of using your computer, your Free memory approaches zero while your Active and Inactive memory goes on the rise. OS X gives more memory to the apps that you use. That's to give you, the user, that creamy, buttery experience. Now when all that green Free memory is down to zero and an application, whether already running or newly started, requests for memory, OS X will have to take back some of the memory it allocated earlier. It can do this using many algorithms, I haven't delved deep into OS X, but OSs typically use Least Recently Used (LRU) or Least Frequently Used (LFU) to determine which memory to release. The data in that memory section gets written back to Virtual Memory. The memory section then gets released for use by another application. I think I'll stop there, before this turns out to be one of my OS lectures. If you want to recover your Real memory try http://www.activata.co.uk/ifreemem/
so, for purposes of brevity: it's probably not a memory leak. more than likely, it's just the way the o/s handles 'things'.
apple on OS X Memory Management: http://developer.apple.com/document...ry.html#//apple_ref/doc/uid/20001880-BCICIHAB More tech-speak on Memory allocation and memory leaks: Finding Memory Leaks: http://developer.apple.com/document...indingLeaks.html#//apple_ref/doc/uid/20001883 "Memory leaks are blocks of allocated memory that the program no longer references. Memory leaks are bugs and should always be fixed. Leaks waste space by filling up pages of memory with inaccessible data and waste time due to extra paging activity. Leaked memory eventually forces the system to allocate additional virtual memory pages for the application, the allocation of which could have been avoided by reclaiming the leaked memory." Introduction to Memory Usage Performance Guidelines: http://developer.apple.com/documentation/Performance/Conceptual/ManagingMemory/ManagingMemory.html Technical Note TN2130: http://developer.apple.com/technotes/tn2005/tn2130.html Viewing Virtual Memory Usage: http://developer.apple.com/document...les/VMPages.html#//apple_ref/doc/uid/20001985
sorry for my late reply. so apparently, it is not really a memory leak but more of a performance management utility made by the application. amazing, but still i find that it still consumes a lot of memory not really helpful when running lots of applications. Safari is still way ahead over Mozilla in terms of consumption, about 2-3x more than Mozilla anyway, as requested previously, Mozilla version prior to 1.5 suffers from the memory leak problem