Macbook hesitates every few minutes - HELP!

Discussion in 'MacBook' started by SamYewell, Feb 9, 2011.

  1. SamYewell macrumors newbie

    Joined:
    Feb 9, 2011
    #1
    I need some help. My white Macbook (2007 model) has developed an issue where it hesitates every few seconds in all applications. For example, if I'm scrolling in a browser window, it will scroll smoothly for a few seconds, then suddenly stop, show the beachball for one second, then continue scrolling (happens in Firefox and Safari). If I'm working in Terminal and I press Tab to complete a filename, it will hesitate (often without the beachball) for one second, then complete the filename. Subsequent tab-completions will work fine for a while, then it'll do it again a few minutes later. Editing a file in Terminal (in vi) will hesitate for up to a second when I first start typing, then catch up and continue normally. Typing in an email (Thunderbird) will frequently pause in the middle of typing and show the beachball for a second or two, then catch up and work normally.

    I see this behavior in both Expose and Spaces -- it will not respond to the hotkey right away but will take a few seconds to start moving. After that, pressing the hotkey repeatedly will be very quick. I see it in Finder, where opening a new window will show no files for a second, then they'll fill in. More new windows will display instantly. Sometimes the beachball shows, sometimes it doesn't.

    I was happy to blame this on caching, but it didn't do this when I first bought it and lately it's been getting worse -- more frequent hesitations that take longer to recover. Two days ago I noticed it's taking up to a minute to react when I plug/unplug the A/C power adapter, even though the orange/green light is always accurate. I rarely turn it off (just put it to sleep by closing the lid), though I have tried rebooting several times to see if it fixes anything -- no change.

    It's a Macbook2,1 - Intel Core 2 Duo 2.16 GHz. I've upgraded the RAM to 4 GB (2x Kingston 2GB DDR2-667). I also upgraded the hard drive to 750 GB (Western Digital Scorpio Blue WD7500BPVT 5400 RPM). Running OS 10.6.6 and using FileVault for my home directory. "Put the hard disks to sleep when possible" is unchecked.

    I don't know if it's related or not, but my keyboard seems to "sleep" quite frequently as well. If I don't type anything for a minute or so, even if the screen saver hasn't activated, my first few keystrokes will be lost while it "wakes up". It's had this problem since I bought it. I remember Apple released an update a while back that mentioned this problem but that update had absolutely no effect for me.

    Can anyone give me some suggestions on how to track down what's going on? I can't tell if this is a hardware issue, an OS issue, some rogue application/driver or something else entirely. Activity Monitor doesn't show any spikes in the graphs when the hesitations occur. Console doesn't show any errors. HELP!

    -- Sam Yewell
     
  2. mr.steevo macrumors 65816

    mr.steevo

    Joined:
    Jul 21, 2004
    #2
    Did the hesitation start before or after you upgraded the memory and/or HDD?
     
  3. SamYewell thread starter macrumors newbie

    Joined:
    Feb 9, 2011
    #3
    I upgraded the RAM first, then the hard drive several months later. I'm positive the hesitation didn't suddenly start after the RAM upgrade, because I was carefully watching for those kinds of symptoms (this unit is only supposed to support 3 GB). VMWare is much happier with more RAM though.

    After the hard drive upgrade, I felt it ran a little bit slower, but nothing like what it's doing now. It was just a feeling; I didn't have any concrete evidence to indicate definite slowness like I do now. As I mentioned, this has been steadily growing worse, it didn't just start one day out of the blue.

    I can try replacing the RAM with 2x 1 GB modules (the way it was sold) and see if that clears it up. If it's the hard drive though, how could I test or confirm that? Is there anywhere I can see how much time the system is spending waiting on the drive? I'm wishing for something like Performance Monitor on Windows that shows read/write queues, idle time and other stats.
     
  4. Jesseeee macrumors newbie

    Joined:
    Feb 9, 2011
    Location:
    United States
    #4
    Paging?

    What is your ratio of Page Ins to Page Outs in /Applications/Utilities/Activity Monitor.app?

    If you have more than 10% Page Outs to your Page Ins, then you are likely running out of RAM and the hesitation is the OS paging that memory to disk.
     
  5. SamYewell thread starter macrumors newbie

    Joined:
    Feb 9, 2011
    #5
    Good idea... currently Activity Monitor says Page Outs are 17.01 GB, Page Ins are 1.66 GB. I haven't rebooted for 31 days, so I assume those numbers have accumulated over time. Free memory is a little over 900 MB, Wired is around 440 MB and Active is around 500 MB.

    If that's the problem, what should I do about it? Obviously adding RAM isn't the answer, since Macbooks with less RAM run faster than mine. I don't run that much stuff and I never leave applications running when I'm not actively using them (in other words, my dock isn't full of running apps with no open windows). Typically I run Thunderbird, a couple of Firefox windows and 5-10 Terminal windows with ssh or vi running. Infrequently I use MS RDC, VNC and iTunes. Is that really too much?

    Could this be an artifact of upgrading the hard drive? Maybe the new drive isn't as fast as the old one? Is there any way I could test it to get some actual numbers?
     
  6. mr.steevo macrumors 65816

    mr.steevo

    Joined:
    Jul 21, 2004
    #6
    Maybe the drive is a lemon?

    I had similar issues when my hdd started to fail. Of course the hardware check (Self-Monitoring, Analysis, and Reporting Technology S.M.A.R.T.) said there was no issue with the hdd even though the grinding noise was nice and loud.
     
  7. SamYewell thread starter macrumors newbie

    Joined:
    Feb 9, 2011
    #7
    Macbook hesitates every few minutes: SOLVED

    Just wanted to post back to say I found the answer to this, in case it can help anyone else.

    The problem was the drive. I finally uncovered comments in a different forum talking about the Western Digital Scorpio drives causing this exact problem. Apparently those drives (both Blue and Black) have a built-in power management firmware that is way too aggressive. After only a second or two of inactivity, the drive starts to spin down. Any access forces it to spin back up, which takes time and causes... hesitation.

    To fix it, I downloaded hdapm (from mckinlay.net.nz/hdapm) and used it to set the power management to "max". Since then, everything has been extremely snappy. No beachballs, no pauses, no hesitations -- the way it used to be. I've added a script to run the hdapm command every time the system boots, because the setting isn't saved when the system is off.

    Thanks everyone for your help.
     
  8. ddehr026 macrumors 6502

    Joined:
    May 1, 2010
    #8
    Would you care to share that script. I am interested! Thanks :)
     
  9. SamYewell thread starter macrumors newbie

    Joined:
    Feb 9, 2011
    #9
    Very simple. Download hdapm and copy it to a folder on your hard drive. I chose /usr/local/bin but you could use /Applications, it doesn't matter.

    Open Terminal. Become root by typing: sudo bash
    Enter your own account password (if you have no password, you may have to set one temporarily, I'm not sure). While you're root, the prompt should end in "#".

    Type: crontab -e
    You'll be in the vi editor (which is very user-friendly but very picky about who its friends are), looking at an empty file. To type, press: i
    Type: @reboot /usr/local/bin/hdapm disk0 max
    (change the path to hdapm to whatever folder you chose)
    Press ESC
    Type: :x
    You should be back at the command prompt.
    Type: exit
    You should no longer be root.
    Close Terminal.

    That's it.
     

Share This Page