The Safari Top Sites + Passenger in Development Problem
Posted: 3:11PM Tagged: Apple, Browsers, Rails, TechnologyIf you do more than a minimal amount of work on a number of Ruby web projects, you’ve more than likely sat down to figure out how to use Phusion Passenger in development. It makes switching between several projects a snap. Ruby and Rails developers have also been known to disproportionately favor Apple machines for their development workhorses. Continue reading if you fit the mold.With the release of Safari 4 came the nifty “wall of screens” feature known as Top Sites. This feature takes your most visited sites and displays them in a nice grid. It’s more pretty than useful, but I’d be lying if I didn’t use it at least once a day.
Lately, the combination of the previously described tools have been causing me pain. One of the things developers tend to do when developing sites is refresh them; A LOT! So typically there are at least a couple of my projects that wind up as Top Sites in Safari. The problem with this is Safari likes to go update those pretty looking screenshots every time you view the Top Sites screen (and randomly at other times). Because I have this set to display when a new tabs open, this is every time I open a blank tab. In other words, very often.
If you haven’t put two and two together by now, what happens when I open a tab is Passenger spawns processes to handle the requests Safari makes (just so it can update it’s screenshots). This ends up consuming several hundred megs of RAM and spikes the CPU load. If you happen to have a memory leak in your application, be prepared to launch Activity Monitor in a hurry to kill the ruby process that is spiraling out of control.
As a solution, you can easily hit the edit button and blacklist the worst offenders, but you have to do so for each unique URL. There is no way to say don’t ever list pages from “localproject.dev” or even “*.dev”. There is also a way to temporarily stop Safari from trying to update the images, ‘Command + .’

