Over the last few days I have still not been able to get in to AHT, so I have now replaced the thermal paste on the CPU and the GPU which still has not seemed to cure the problem. I swapped the RAM over a while ago and this problem never occured before that, I am now considering swapping it back over for the old RAM to see if that changes anything.
I will let you know if it works.
Thermal paste is one of those rock and a hard place problems. Too much, you give it too much insulation. Too little, and it overheats on its own. It is best to let an authorized service technician do a thermal paste application if you aren't one yourself, as only they know the exact amount that will qualify for the equipment.
Luckily I work in a PC repair shop and repair PCs and Macs all day long so I have an idea what I am doing.
As I said the thermal paste didnt cure the problem but everything else is still working perfectly normnal, I have swapped the RAM to another two 2GB DDR2 peices which has again not cured the problem as it froze on me the other night. (I put it to sleep and it would not come of sleep mode, it just had a black screen)
I am now moving on to my last idea of doing a complete clean install of OS X Mountain Lion.
I am pretty sure it is something really simple as I never had this problem before I upgraded the OS or the RAM.
I will let you know what happens.
Is the RAM to Apple's specs?
Macs are very picky about RAM and just can't use any ole' PC RAM.
Here are the proper RAM specs for your model iMac.
6.0 GB (Actual) 4.0 GB (Apple) Memory Slots 2 - 200-pin PC2-6400 (800MHz) DDR2 SO-DIMM
Reliable Mac RAM can be purchased cheaply from online Mac RAM vendors Crucial memory or OWC (aka macsales).
This maybe your issue.
4 GBs of RAM in your iMac is enough to run OS X alone, by itself.
Every new iteration of OS X uses more CPU, GPU, RAM and hard drive resources.
OS X needs to have a working minimum RAM amount of between 2-4 GBs to do its thing smoothly, quickly and efficiently.
Start running additonal apps atop or along with OSX and your iMac slows in performance and may, on occasion, crash.
Since you like leaving applications running in the background, I would recommend installing the additonal 2 GBs of RAM to bring your iMac to a max. of 6 GBs of RAM.
This should help you with some of your issues if it isn't hardware related.
Tthe RAM has to be to the exact specs.
And no, if the RAM spec is close, it may indeed boot up, but the Mac could exhibit issues right away or may have issues that could happen over say a few days to a week.
If your IMac is crashing, it maybe that the RAM is not quite be the proper specs.
Crucial memory and OWC have the proper and reliable RAM for Macs.
If you bought this RAM locally at some electronics or computer store, I can almost guarantee it's not proper spec'd RAM.
Getting the exact speed is not necessarily sufficient. Timing has to be exact. That's often not fully published. Only vendors that sell RAM by Mac model name & vintage are known to give you the correct specs*: http://www.macmaps.com/badram.html OWC (macsales.com) is one of them.
I have now place the original RAM back in to the iMac which it seemed to like for a bit until it froze up again, but with this RAM it lasts a lot longer than it usually did.
I have now done a complete clean instal of OS X Mountain Lion and put back in 2x2GB of DDR2 6400S RAM and it froze on the first day(today).
The only other option I can think of is to change the HDD.
Another thing aswell it is warm at the top of the Mac which makes me think either the HDD is getting hot or the Logicboard is as I have cleaned the whole thing out before.
Also for the first time it froze but I could still move the mouse but could not click on anything, I have seen a lot of people on the forums with this issue. Hope that helps.