views:

354

answers:

7

I am on OSX, and my system is becoming unresponsive for a few seconds roughly every 10 minutes. (It gives me the spinning beach ball of death). I was wondering if there was any way I could isolate the problem (I have plenty of RAM, and there are no pageouts/thrashing). Any Unix/OSX tools that could help me monitor and isolate the cause of this behaviour?

+1  A: 

As a first line of attack, I'd suggest keeping top running in a Terminal window where you can see it, and watching for runaway jobs there.

chaos
yes, top is open (as is activity monitor), but there isn't any heavy CPU load being shown.
mt3
+1  A: 

I'd run a mixture of 'top' as well as tail -f /var/log/messages (or wherever your main log file is).

Chances are right before/after the hang, some error message will come out. From there you can start to weed out your problems.

Eddie Parker
+1  A: 

If the other answers aren't getting you anywhere, I'd run watch uptime and keep notes on the times and uptimes when it locks up. Locking up about every 10 minutes is very different from locking up exactly every 10 minutes; the latter suggests looking in crontab -l for jobs starting with */10.

chaos
Yes, it isn't exactly 10 mins, just approximately 10 mins. Thnx for the suggest nonetheless.
mt3
+2  A: 

Activity Monitor is the GUI version of top, and with Leopard you can use the 'Sample Process' function to watch what your culprit tasks are spending most of their time doing. Also in Utilities you'll find Console aka tail -f /var/log/messages.

HUAGHAGUAH
I think you meant Activity Monitor?
mt3
+3  A: 

Activity Monitor (cmd+space, type, activity monitor), should give you an intuitive overview of what's happening on your system. If as you say it is there are no processes clogging CPU, please do take a look at the disk/IO activity. Perhaps your disk is going south.

ayaz
+1  A: 

Periodic unresponsiveness is often the case when swapping is happening. Do you have sufficient memory in your system? Examine the disk io to see if there are peaks.

EDIT:

I have seen similar behaviour on my Mac lately which was caused by the filesystem being broken so OS X tried to access non-existing blocks on the disk and even trying to repair it with Disk Manger told me to reformat and reinstall. Doing that and reestablishing with Time Machine helped!

If you do this, then double check that Journalling is enabled on the HFS on the harddisk. This helps quite a bit avoiding it happening again.

Thorbjørn Ravn Andersen
+1  A: 

Use Apple's Instruments. Honestly, it's helped immensely in finding hangs like these.

Rev316
any further advice on using instruments for this purpose? i imagine this is the most powerful approach.
mt3