My problems started when I upgraded to 10.7.1 so it looked like it was a software issue. I tried everything suggested in this thread to fix it but it never went away. Called up Applecare finally, and after going through some more software fixes, mainly uninstalling a few background apps, I had only one option left -erase and install. Took me about 2 weeks to backup and prepare for that. (things like recording all my software activation nos., passwords, etc.)
Turned out, even with a bare bones install of Lion, I still encountered the crashes and freezes. which meant a hardware issue. So it was off to the genius bar hoping i won't need a new logic board. To my relief, I just needed a new graphics card. $170 + tax, includes labor.
I asked the techie was it just an unfortunately misleading coincidence that the problems started immediately after I upgraded to 10.7.1 and he said it could be, but sometimes an OS upgrade may put more demands on a hardware component and reveal and worsen an existing weakness or defect.
Anyway, so far, happy sailing on my iMac.
BTW, when I searched for Mac parts, some vendors were selling the graphics card for $385 and the logic board for $1600. I saw a couple of vendors selling the logic board for $550 though. The genius bar said a logic board repair would cost about $750. Repair costs, including labor, are surprisingly reasonable! Even compared to DIY where you don't get a 90 day warranty and a free do over if the repair doesn't work.