Take the 2-minute tour ×
Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

Ever since upgrading my Mid-2010 MacBook Pro to Lion a few months ago, it sometimes gets extremely sluggish. When it does, every time I switch applications I see something like this in the menu bar:

Blacked-out application name in menu bar

It stays like that for 10-20 seconds while the system is unresponsive. The mouse is a beachball when I hover over the menu bar. Then the application name appears and the application becomes useable again (but still slow, like everything else). Logging out and in makes the whole issue go away, at least for a while.

What could be causing this?

share|improve this question
add comment

1 Answer 1

up vote 2 down vote accepted

Hard to say without a few more details. I'm assuming for now that you don't have an SSD, but a mechanical spinning hard drive.

The problem of the blanked app name and the sluggishness may be symptoms of the same problem.

You say the problem happens when you switch application? So the system will be activating that app, and redrawing the menu bar. Does it happen more when you switch to apps you've not used in the last few minutes? That would support a diagnosis of not enough RAM. The blanking might be explained by the whole app having been swapped out of RAM, so before you can switch to it it has to reload from disk. Also the fact that logging out and in again helps also supports the not enough RAM theory because that means you are quitting all apps - and thereby reducing the competition for RAM.

10-20 seconds is a long time for this, but is possible if your hard disk is badly fragmented. While Unix filesytems are typically not too bad when it comes to fragmentation, but if your disk is fairly full and you've just changed a lot of large files (like an OS update would) then you may be seeing a bigger impact. I had a similar performance issue because my virtual memory file was split into about 20,000 pieces all over my hard drive, and defragging felt like getting a new machine!

I should add a caution about defragging - only do it on spinning disks - not on SSDs. On SSDs it makes no detectable difference - but does reduce the life of the drive.

So first off, let us know how much RAM you have, and second use a tool like iDefrag to see (in the first instance how badly fragmented your drive is). If it shows up as very badly fragmented then go ahead and defrag. You should backup before defragging. Life will be easier on you if you clone to an external drive rather than just using Time Machine (and make sure you can boot off the clone before you continue), and it might even be quicker to clone to an external drive and then clone back again. Defragging can take a very long time on a badly fragged disk. It took about 18hours that time my machine got sluggish!

I'd suggest for lion 4GB is probably a minimum depending on what you're doing with the machine. A bit of light word-processing is not going to put as much strain on the machine as doing video editing or other media heavy tasks. If you routinely us lots of apps at the same time, you'll also need more RAM.

If you have enough RAM the other possibility is that you have a program which has a memory leak, meaning it's demanding ever more RAM from the system, which will eventually mean things get pushed onto disk. You should be able to spot that in Activity Monitor - look at the Real Mem column (not the virtual men column). As a guide, on my machine here, kernel_task is using 718MB, which is the largest chunk, Thunderbird is next with 212MB. If you see an app where the Real Mem keeps going up then it might be leaking. You'll need an update for that app in that case. The other thing to look at in Activity Monitor while you're there is the Disk Activity. If that spikes a lot when you switch apps then RAM will definitely speed things up.

share|improve this answer
    
Yes, I've got a mechanical HD. I've got 4GB of RAM, and could bump it to 8. I hadn't thought about fragmentation. That's not a bad idea at all. It's probably not a memory leak, because it happens to just about every app at some point, but yes, always apps I haven't used in a while. And my disk activity does spike. I'll upgrade the RAM and defrag the disk. Thanks! –  Peeja Jun 11 '12 at 16:24
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.