MacOS – Why does Safari always hang

hangmacospluginssafari

I use Safari as my browser, but I've found that it frequently hangs for 20, 30 seconds (sometimes longer), often times when I wake it up from sleep and/or when I open a new tab.

Though I'm not sure it would be helpful, the next time it does it I'll see if I can sample the process and report back with the results. In the meantime, is there something I can try? I'm running on a mid-2007 MacBook so, while I think I have enough processing power (2×2.16Ghz) and memory (2GB), I suspect it's a disk issue.

Is there something I can do to reduce disk usage? Should I clear my cache (this isn't a problem), my history (I want to keep this if possible) or both?

edit: Is there any way to determine what plugins I have installed? I have RescueTime and Evernote, so either of them could be the culprit, but I know that there are programs that like to install hidden extensions, so that could be the problem as well.

By the way, here's that sampling output summary – I've cut out the call tree as it was way too long to post:

Total number in stack (recursive counted multiple, when >=5):
        21       _pthread_start
        21       thread_start
        7       __semwait_signal
        7       mach_msg
        7       mach_msg_trap
        7       pthread_cond_wait$UNIX2003
        6       CFRunLoopRunSpecific
        5       CFRunLoopRunInMode

Sort by top of stack, same collapsed (when >= 5):
        __semwait_signal        2058
        mach_msg_trap        2030
        semaphore_wait_signal_trap        589
        select$DARWIN_EXTSN        588
        0x0        294
        __workq_ops        294
        semaphore_timedwait_signal_trap        294
        kevent        293
        pread$UNIX2003        116
        fsync$UNIX2003        50
        WebCore::BinaryPropertyListSerializer::appendStringObject(WebCore::String const&)        42
        WTF::HashMap<WebCore::String, unsigned long, WebCore::StringHash, WTF::HashTraits<WebCore::String>, WTF::HashTraits<unsigned long> >::get(WebCore::String const&) const        19
        write$UNIX2003        19
        __dtoa        15
        WebCore::IntegerArrayHash::equal(WebCore::IntegerArray const&, WebCore::IntegerArray const&)        13
        WebCore::String::characters() const        11
        WTF::HashMap<WebCore::IntegerArray, unsigned long, WebCore::IntegerArrayHash, WebCore::IntegerArrayHashTraits, WTF::HashTraits<unsigned long> >::get(WebCore::IntegerArray const&) const        7
        __memcpy        7
        WebCore::String::isEmpty() const        6
        __sfvwrite        6
        WebCore::BinaryPropertyListSerializer::addAggregateObjectReference(unsigned long)        5
        __vfprintf        5
Sample analysis of process 18283 written to file /dev/stdout

Best Answer

In my book, Adobe Flash is always the first culprit for issues with browser stability and responsiveness. Try installing ClickToFlash and see if that helps things.