Oldish Imac G5 - powers itself off after about 30 mins

Wonder if anyone can offer any advice. I have an iMAC G5 bought in 2005. Its the old white 20" screen one without Isight and with 2 memory slots. It has devloped a fault where it just powers itself off after about 30 minutes. In the past I upgraded the memory from 1 x 256 Dimm to 2 x 512, and I read that sometime this fault is caused by memory so switched back to the old memory but problems still exists. Problem exists while browsng internet, playing cds etc, doesnt seem to be one particular thing that causes the problem, gut feel is that it could be an overheating problem ?

Its running a really old version of the OS but I didnt want to upgrade while this problem exists as I think it will fail half way through.

Any ideas what I can do ? Tried looking at official apple support but they say that the machine is too old for them. Do I cut my losses and look to replace or do I try and get this problem sorted.

Well your iMac is very fussy about compatible memory. Did you purchase from a Mac dealer or seller? You need low density modules and not cheaper high density PC memory, and what you are describing is exactly what occurs with the wrong memory.

Have a look at this link and check the specs of the memory you installed.

No, no error messages or anything it just powers off (like pulling the plug as you say).

I had read about the memory causing this so thats why I put the original back in, but the problem still happens with the original memory (which did work ok for at least 3 years). Original MAC bought from very respectable department store
The replacement memory was bought from an apple supplier (bit not apple itself) and found by my techie friend, but could still be an issue. Apple itself no longer stocks memory for this as its too old.

Anyone know how much, and how easy it is, to replace the power supply ?