blog

Advertising, marketing, mac stuff and bla.st news from bla.st. Feel free to get in touch


Recent Entries

WordJot has been launched
27th March 2008

Bla.st is for sale
2nd March 2008

Entrecard - "Looks a lot like bla.st"...
1st February 2008

bla.st downtime
15th November 2007

New card feature: Headings! Some simple SEO tips
22nd October 2007

Make money online with the bla.st referral link
5th October 2007

Several subtle bla.st changes
27th September 2007

5 Reasons BlogRush Has Already Failed and Why Bla.st Will Take Over
24th September 2007

Older Entries

bla.st should do this...

More great bla.st reviews

New Bla.st Marketplace Page: See who's using the bla.st widget

How to Never Clear Out Your Inbox Again

When advertising attacks

A month with bla.st review

More sites using the bla.st widget

bla.st vs milliondollarhomepage & pixelotto

Widget referrals now earn 50%

6 months of website promotion tips in 2 minutes

Make money with bla.st cards on your site: the bla.st widget and referral programme

1000 cards!

bla.st faster and more reliable thanks to new server

bla.st outage

bla.st RSS feeds now enabled and more

Internet Advertising on the Rise

Keep Safari and OSX running fast: Work around the memory leaks.

How to stop email spam, worldwide, for good.

Update your card image and other admin improvements

New Stuff Including a New Header Design, Section Tabs and a Redesigned Footer

Great list of Interesting Marketing Sites (including this one!)

Our lesson of the day: expectations

jobfavors.com and woorkboot.co.nz improvements

johnchow.com reviews bla.st through reviewme.com

Which is better for your site: www or no www?

New Feature: Info hover panel now with Language, Card Type, and Caption

Link previews (like Snap) are completely backwards

Super friendly URLs - handling spaces with URL Rewrites and PHP

bla.st news - no more countries!

the old million dollar hompage passes pixelotto.com in traffic

The 3 best minimal blogs on the web

What print designers should know about fonts on the web

How to stop RSS feeds from ruining your productivity (without giving them up)

bla.st interview on profy.com

OmniWeb vs Safari/Saft - which is the most awesome?

MacProMozaik - A bla.st inspired site launches :)

New Feature - "Popular Cards" shows the most and least popular cards on bla.st

PageBull, an interesting visual search engine

11 tips for growing large scale websites from nothing

blatant bla.st bribery - free card upgrades for blogging about/linking to bla.st

Testing out memcached (a technical announcement)

The Ad Generator

"bla.st partners with adetchr.com" or "laser etched macbook pros are so cool"

Kind words from WinExtra.com

Has Pixelotto stalled?

A bla.st milestone: Over 2 million cards served!

Featured Card: Blund

New bla.st record set thanks to Spanish blogs

The hypocrisy of the crippled Apple iPhone

The place where spam is welcome: bla.st

Free advertising that's actually usefull

14 big Apple iPhone questions

Someone wants to make their own bla.st

iChat update just before Macworld... coincidence?

Macworld bla.st promotion: Free bla.st card design for up to 25 Mac related companies

Last Minute Prediction: The Apple WiFi Phone

New features: "Small" cards, card expiration notifcations and extended time online

9 essential things everyone should know about email

The Genius of the Visually Inconsistant Mac User Interface, Part 2

Process your URLs in PHP with Apache mod_rewrite and wildcard DNS

16 simple tips for making your site search engine friendly

Information Architects predict "More money for Internet Advertising" in 2007

Photoshop CS3 beta mini review and performance tests on a G4 PowerBook

The Genius of Apple's User Interface Themes

stuff.co.nz and nzherald.co.nz relaunch: uncanny similarities

Advertising Made Awesome - bla.st has a new colour scheme

New tiny cards!

adgridwork - A free advertising network to try

Site downtime and DNS issues

Merry Mailer Madness Month

Ideas for a website tag system

New front page design

bla.st iPod competition winners announced

Turkish cards coming to bla.st

Improved outgoing links and stats

Competition finished

The Obfuscator - Protect emails from spam

New Ajax style 'related keywords' and 'filter by keyword' buttons

How OS X menus could be made more useful

Only 7 more days to go in the draw to win one of 2 iPods

6 Sites That Have Evolved From Pixel Advertising

43ads - another web advertising money making scheme

Funniest ad for shoes ever

How web browser uploads could be made awesome

Win an iPod competition launched

The Dominion Post writes about bla.st

6 ways to improve the million dollar homepage and make your fortune

Found a similar money making scheme to bla.st!

bla.st linked up to Google Maps

bla.st online card builder now online

blastastic

« Blog

Keep Safari and OSX running fast: Work around the memory leaks.

9th March 2007 12:21AM

Safari has a huge memory management issues. To be precise the problem is not with Safari, but WebKit, the engine that powers Safari and other browsers like OmniWeb. Sitting around moaning about it doesn't really help, but hopefully this will make clearer what problems some users, including myself, are having.

Basically the more pages you look at, the more memory your browser will use. The problem is WebKit does not release this memory back to the system until the application is quit. If you're a heavy web user, or like many people simply leave your browser continuously this becomes a major problem. Memory on MacOS X is complicated, but basically when your system runs out of memory, it starts paging other applications to disk. It gets to the point where opening new web pages is slow because it has to page something to disk, and switching to other applications is painfully slow because it has to load them back.

There is more discussion of the problem over on the webkit.org blog.

A simply but dirty solution is to simply quit and reopen Safari as soon as the system starts paging to disk. A memory monitor is a good investment too, I use iPulse to keep an eye on things. So when does Mac OS start paging to disk?

Activity Monitor

Memory on OS X is divided into 4 different types. Wired, Active, Inactive and Free. I have no idea what the all are exactly, although there are other artciles that explain it all. What I do know is when Inactive + Free reaches 70%, my system starts paging to disk and swapping memory around. iPules is good like this because it gives you that percentage figure, so you can easily keep an eye on it (see below). When I hit 69% of "in use" memory I know if I open another application, or keep browsing, something will be paged back to disk. Thanks to my PowerBook 4200rpm hard disk, this is painful and I avoid it where possible. Here's memory at it's upper limit:

Memory Usage

So why does WebKit not release memory back? I have no idea. I've tried everything you can think of. Closing windows. Clearing the cache. Turning the developers menu on, and clearning the WebKit cache's. I've even tried not using any cache at all. No matter what, the only way to reclaim memory is to quit the application.

So how fast does WebKit fill up with memory? It depends greatly on how many pages you are looking at, and what's on the pages. Sites that use a lot of images seem to chew up the memory quick. Generally I need to quit Safari or OmniWeb every couple of hours. It often reaches 300-400MB before I run out of memory I guess that WebKit is caching images and not giving that memory back.

So what's the solution? Well ideally OS X should always use as much memory as it can, but avoid paging to disk if possible. This means apps like Safari should cache as much as possible, but be intelligent enough to empty out the cache when memory starts running low. I don't know if this is possible, perhaps a simpler option is to let users set a limit of how much memory WebKit can use, much like Photoshop.

Unfortunately a number of other apps also suffer from a similar problem. iTunes CoverFlow is a great example - iTunes starts small, as album covers are viewed memory usage increases, switch back to list view and memory isn't freed up. Apple Mail does this viewing large attachments too. Is this a flaw with the individual applications? Or a more fundamental flaw with how OS X handles memory? I have an older application, Macromedia Freehand. If that loads a big file, it releases all of it when the window is closed. Why can't cocoa apps work like that?

Any thoughts or ideas? Can any Apple developers let us know what the story is? Leave comments at the WebKit Blog



Got a website? Promote it on bla.st free