Safari the memory hog

Safari is a great Web browser, but despite its benefits it can be quite a memory hog and depending on your system, having the browser or any application use a lot of memory may impede on the performance of other applications.

Safari is a great Web browser, but despite its benefits it can be quite a memory hog. I regularly see it using between 400MB to 600MB of real memory, which in day-to-day activities should not matter much for people; however, in some instances people have seen it use well more than a gigabyte of RAM. Depending on your system, having the browser or any application use large amounts of memory may impede on the performance of other applications.

Upon first launch, Safari seems to use an expected 150MB to 200MB of RAM, but that amount may grow in size as you browse, until it reaches between 400MB and 600MB. It may fluctuate a bit, but tends to sit at this level even when windows are closed.

Safari can sometimes use a large amount of RAM.

Some have claimed this behavior is a "memory leak," which is caused by a program reserving RAM for some use and then either not releasing or keeping track of the memory space being used. If this happens, the next time the program runs that same routine, a new chunk of RAM will be allocated, causing the program to use more and more system memory.

Generally if you keep performing the same task that has a memory leak, the amount of RAM used will grow until the system runs out and gives you errors. However, since Safari's RAM usage seems to plateau (albeit at high levels) and not keep growing even when you repeatedly perform the same tasks, it suggests Safari is just reserving that amount of RAM and not necessarily suffering from a memory leak.

Memory leaks would require a fix from Apple, but regardless of the specifics, there are a few ways to address RAM problems with Safari (or similar applications such as Mail, which uses the same engine to render HTML).

Remove or update plug-ins

Web plug-ins can be the root of a memory leak, or large memory usage. If you have installed a number of plug-ins, you might consider removing them. Most will be located in /Macintosh HD/Library/Internet Plug-ins/, but some might be in the /username/Library/Internet Plug-ins/ folder. Other applications may have their own "Plug-ins" folders from which you can remove plugins.

Standard plug-ins you should expect to have for Safari include:

Flash Player.plugin
flashplayer.xpt
JavaPluginCocoa.bundle
Quartz Composer.webplugin
QuickTime Plugin.plugin

Quit and relaunch Safari

An easy workaround to any program using a lot of RAM is to quit and relaunch the program. This is especially true if you tend to sleep your computer with Safari running instead of quitting the program by logging out or restarting. Doing this will keep the program active in memory and will not force it to relinquish any RAM.

If you keep a number of browser windows and tabs open for your work, you can easily get them running again by selecting "Reopen All Windows from Last Session" in the "History" menu, making the relaunch process far easier.

Clear caches and reset Safari

In addition to quitting and relaunching Safari, clearing the program's cache may help prevent heavy RAM usage. This can be done directly from the "Safari" menu, or alternatively from the "Reset Safari" options in the same menu. The reset options can also be used to clear more than just the cache, which is another possibility you can try. Keep in mind that doing this may reset automatic log-ins and other site-specific behavior.

Use iFreemem

Utilities such as iFreemem can help free RAM from the system and other applications by putting a temporary heavy demand for RAM on the system. Doing this forces applications to relinquish unused memory that they have reserved.

Get more RAM

RAM is fairly cheap and you can easily double the amount in your system. While Safari may use a lot of RAM, unless something is wrong it should not take up gigabytes of RAM, so for general Web browsing and office work you might consider adding another gigabyte or two of RAM to compensate for Safari's uses. If you have an older system that has 1GB of RAM or less, I recommend you put at least 2GB in the system but alternatively go for as much RAM as you can afford, especially if you are running OS X 10.5 Leopard.

Use another browser

Safari is great, but if for some reason it is not working as expected you can at least temporarily use another browser. Firefox and Camino are a couple of popular options, but Google's Chrome is based of the same "Webkit" engine as Safari and therefore will also provide a similar browsing experience. However, Chrome is still a beta release so I would not recommend you rely on it, especially for private and important work.


Questions? Comments? Post them below or email us!
Be sure to check us out on Twitter and the CNET Mac forums.

Tags:
Computers
About the author

    Topher, an avid Mac user for the past 15 years, has been a contributing author to MacFixIt since the spring of 2008. One of his passions is troubleshooting Mac problems and making the best use of Macs and Apple hardware at home and in the workplace.

     

    Join the discussion

    Conversation powered by Livefyre

    Don't Miss
    Hot Products
    Trending on CNET

    HOT ON CNET

    Up for a challenge?

    Put yourself to the real tech test by building your own virtual-reality headset with a few household items.