I am also seeing this issue - work-around is to just use another browser. this clearly is not a fix however. The process seems to max out one of the processors cores. There does not seem to be any pattern of what website triggers this.
MacBook Pro 15-inch, Mid 2010
Processor 2.53 GHz Intel Core i5
Memory 8 GB 1067 MHz DDR3
Graphics NVIDIA GeForce GT 330M 256 MB
Software Mac OS X Lion 10.7.3 (11D50b)
Safari Version 5.1.5 (7534.55.3)
The problem is more complex than just a memory leak. My daughter was running safari and has top sites turned on. She LOGGED OUT of her account, which should have killed all the processes she was running; but when I logged into my account, I had extremely sluggish finder performance and lots of spinning beach balls. After I finally got Activity Monitor open, I discovered that Safari Webpage Preview Fetcher was locking up 5.5 gbytes of my 6 gbyte block of RAM. Furthermore, the process was tagged with her account. I verified that she was logged out, but it had apparently spawned a persistent process that had to be killed via system commands.
I'm seriously thinking about uninstalling Safari completely from my system and migrating everything over to firefox or chrome. I don't like buggy applications that act like malware. This has been, apparently, an ongoing problem for many years, and I don't think apple is going to address it, or they would have solved it by now.
I also noticed that Safari will spawn persistent JAVA processes that survive my kid's logout and screw up the sound output so that only the internal speaker works (disables the line-out). By killing this persistent Java process that is tagged with my kid's account, magically, line-out function is restored immediately.
You can essential "neuter" Top Sites so it doesn't launch. I also had the issue of the Fetcher being out of control and did the following:
1) In Safari Preferences > General, I set any preference that said "Opens with" to something other than top sites.
2) In Safari Preferences > Bookmarks, I unchecked the option to show the Top Sites icon in the Bookmarks bar.
3) In the Safari Menu, I selected "Reset Safari" and used the following checkboxes:
then hit "Reset"
4) Restart the comptuer.
This sets up the browser so that Top Sites will not be involed, thus turning off the Fetcher. You can easily reverse this if needed.
Since doing this, I've had not further issues with the Preview fetcher.
As for Java, I need to leave that to someone else.
One reason for a slowness in page loading may be the 'DNS Pre-fetching' feature of Safari 5.x as is described here: http://support.apple.com/kb/TS3408?viewlocale=en_US
You can cancel DNS pre-fetching by going to Terminal and typing:
defaults write com.apple.safari WebKitDNSPrefetchingEnabled -boolean false
You have to restart Safari for it to take effect.
Thanks for the detailed, step-by-step. I've already blocked top sites in my account, but didn't think about the extra cleaning steps you suggested. I'm still inclined to uninstall safari rather than have to to touch labor in my kids' accounts, establish limits on which functions they can use in the browser, and then play policeman when they decide that their convenience outweighs a rule. Afterall, "why put the cool function in if you can't use it". I'm disinclined to treat the symptoms and develop work arounds, rules, and policing, when a simple browserectomy gets rid of the diseased part and replace it with a fully functioning and healthy one?!
Any application that 1) has this kind of memory leak AND 2) spawns processes that persist in memory after the mother application is shut down AND after the user logs out of his/her account, is 3) a likely cause of other conflicts and intermittent problem that users are experiencing when they have various combinations of processes running in support of mutliple apps. The fact that I only positively correlated some problems with Safari doesn't mean that it isn't causing others. In fact, an application that has memory leaks and spawns persistent process that survive a application shutdown is fundamentally flawed and is likely to have other flaws that haven't been revealed.
That is why I'm not real keen on operational workarounds : I expect software that I use to conform to certain standards and NOT do things violate those standards. Operational workarounds are sometimes necessary; but not when properly functioning and suitable alternative solutions are readily and freely available.