Monday, April 13, 2009

Safari uses CPU 100% - corrupt SafeBrowsing.db

On 2 of my OSX (10.4 and 10.5) machines, Safari started consuming 100% CPU. After a bit of research it seemed that it was the new Safe Browsing feature introduced in 3.2(?). Basically with the feature "Warn when visiting a fraudulent website" after 2 minutes Safari would ramp the CPU to 100% and it would stay there, for ever if you left it. Then when you tried to quit it would crash.

I tried a different account, and found that other accounts on the same machine didn't have this problem.

Then I used Activity Monitor while Safari ramped to 100% to see what Safari was doing. In Activity Monitor, click on Safari, then get-info, click on 'Open Files and Ports'

and copy and paste into a text file. Reading through I see


so the next step was to force quit Safari, and rename this file

    cd /Users/name/Library/Caches/

    mv SafeBrowsing.db SafeBrowsing.db.old

restart Safari, and this file gets recreated. Safari does ramp the CPU but after a minute or so its back to normal.

BTW this file is created by Safari downloading from, so you should ensure access to that hostname.


Anonymous said...

Thanks! This solved my problem.

Unknown said...

glad it helped!

Doug Clinton said...

Thanks very much, that solved the problem for me, too.

BTW, the SafeBrowsing.db wasn't in the Library folder shown in your post on my machine. Instead I tracked it down to /private/var/folders/Uu/UuJyAhmfFcOpPvLzlS+BpE+++TI/-Caches-/ which will obviously vary from system to system so if you're having this problem and can't find the file, it may be under /private/var/folders instead.

Unknown said...

Interesting.... what version of Safari do you have?

Anonymous said...

wow thanks!
This solved my problem.
The same has happend to me, with Opera 4.0.3 running on MS Windows.
Must be some SQLite Error I guess.

Anonymous said...

Wow 35 mins of searching forums for answers and you FINALLY solved my problem. Thanks.

Unknown said...

no problem... maybe my solution will get higher in the Google search rankings :-)

THATGuyEd said...

To all...

/private/var/folders/JF/JFO03PYjEPW4bgiq4jxwm++++TI/-Caches-/ was the path on my system and SafeBrowsing.db(.old) was the culprit.

Thanks to all (^_^)

DSF said...

My computer has been frequently entering into sleep mode and the only thing I can see is that my CPU is always at 100% (mainly due to Safari). I've adjusted the file as you've said and it has certainly brought the level down. hopefully this has sorted out the issue

thanks :)

The Specialist said...

Same problem here, youre fix worked great! even with safari 5.1.3. and osx 10.7.3.

Stuart Grandin said...

Hope this helps you!!


Mike said...

This really helped me. i took a blunter approach - i deleted the whole folder and then relaunched. the folder was rebuilt and the issue went away.



izzzzzz6 said...

Hi Guys i am thinking this could be my problem. I am often getting over 100% CPU usage with safari and it is then often not responding and i get 5-10 seconds of spinning beach ball no matter how few/many tabs or windows are open.
Could someone explain to me in more detail how to complete the above procedure?
I don't really understand the part about deleting the file. He says:
"so the next step was to force quit Safari, and rename this file

cd /Users/name/Library/Caches/

mv SafeBrowsing.db SafeBrowsing.db.old"

Why does it say cd then a space before the file path? and then new line "mv SafeBrowsing.db....."??

I tried to find a video on it but could only find a version for safari running on a PC and i couldn't really understand the guys accent.
I recently upgraded to 10.11.6 El Cap for the last month or so my fans have not been spinning fast but since doing the updates a few days ago the fans are running fast and machine is hot. Safari sometimes only uses low CPU% but often it go's to over 100% and it hangs for a few seconds or more.
I'm lost. Can anyone help?