It happened to me twice recently. I was just using my iMac normally, like browsing the web, and it suddenly freezes. I can move the mouse, but I can't click on anything. Keyboard not functioning at all. I couldn't figure out what to do except for pressing the power button and reboot. What else can I do? Is there a way to diagnose and find out what is causing it?
A strategy to try when the freeze is actually happening is holding ⌘ Cmd and ⌥ Opt, then hitting ⎋ Escape.
If your keyboard input is still working, this should bring up the force-quit dialog (which can be navigated using the arrow keys and Enter). This may allow you to close problematic applications without a hard shutdown using the ⌽ Power button.
Usual troubleshooting steps for similar cases are:
- Clean system and user cache (slightly dangerous procedure if you don't know what you're doing) there is a program called CleanGenius that might help, but it's been severely limited due to the new sandboxing policies introduced with OS 10.7
- repair Disk Permissions (easy, you can do it with Apple's Disk Utility, which is installed by default in the Utilities folder)
- Reset PRAM (easy, you need to start up your computer keeping four keys pressed: command, option, P, R and release them AFTER you heard the startup chime TWICE)
Those steps should solve the problem.
Differential diagnosis would be checking the RAM for a defective bank and checking internet plugins (but in that case, I suppose not all the system would lock up, just the browser) and processes running in the background. But for this kind of diagnosis, I would suggest entrusting your Mac to a specialist.
Try cleaning the dust bunnies out of the video card. After months of making me crazy I think I tracked it down to dust blocking the heat sink channels on my video card. I was blaming my freezed on Flash, but I realize that was working my video card just hard enough it got hot and quit. Haven't had a freeze in days.