My 27" i7 couple of years old iMac has in the last week become unstable. Generally it is after a couple of hours of use but beyond that I have seen no pattern but whilst doing light web browsing etc the Dock and Wall paper both disappear to be replaced with a mid grey background and the cursor turns into a beach ball. If I leave it in this state for a few minutes eventually the whole screen goes white/ light grey. Typically I have always left the iMac to just go to sleep on its own when I've finished using it but now without fail the computer will have crashed within the few hours between use. The only way to get the computer working again is with the power button. Whilst I have been a mac user for a couple of years now it has always "just worked" and so I am not very good at maintenance on it. I have repaired disk permissions and reset the NVRAM but neither of these have improved the situation at all. Can anyone suggest next steps or how I actually diagnose the root cause?