I've had my desktop for ~4 years now, and recently it started behaving really badly:
Whenever I run a Flash webgame or anything that takes up a great deal of memory - like a game, for example - everything will work fine for awhile, but after 10-15 minutes, the computer comes to an immediate halt. The fan goes dead, the computer turns off, the monitor goes blank. It behaves as if someone has just yanked the power.
What are some things I can do to troubleshoot this problem?
Perhaps the CPU is overheating? Maybe I've got some bad RAM?
Although I don't think it matters, I'm running on Windows XP.
Note: I realize this isn't exactly a "system administration" question since I'm dealing with my own personal desktop and it's not really serving anything up to the outside world at the moment. However, I'm asking for general troubleshooting tips for the symtoms described above - Symptoms that I think could easily be applied to computers/servers in general. If you don't think this is appropriate, feel free to close.
I have fixed problems like this in the past by replacing the power supply. I had a computer that would randomly completely shut off with no warning. Linux, in this case, but as you said, the OS probably doesn't matter. Replacing the power supply fixed it and the problem never recurred.
Although power supplies have no moving parts (except for the fan), they wear out surprisingly often. I'm not certain how one could prove that the power supply is the root cause of the problem other than swapping it out and trying.
I try to always have one spare power supply on hand so I can at least test this without investing in a new power supply. The spare is usually one of my working but older power supplies. That is, my spare is not a new, unused power supply, since this is just for home use.
It seems very likely you have an overheating problem - If it was the CPU it would likely blue screen.It seems like this is only happening under load. I would check the power supply -
either being overloaded
or
the fan in the PS is not working correctly
To troubleshoot - Take a look at the PS - is the fan spinning you could try another power supply.
What's it look like inside? 4 years running, you say? Pop the cover and have a look. The dust bunnies may have set up a nice condo inside your machine.
Like you mentioned, the most likely culprits are overheating and bad RAM. The next thing to check would be the video card (clean the fan) and hard drive (bad sectors in the swap file equals bad RAM - perhaps move the swap file to another drive or partition to test?).
Have you updated or downgraded any drivers lately? I've had the exact same behavior on a certain motherboard at some point due to Realtek's crappy sound card drivers (onboard HD audio.) I had to play around with a few versions until I found one that worked.
Check your heat sink on the CPU.
I know it sounds unlikely, but a cpu can heat up enough to shut down the computer in about 5 seconds without a heat sink (not long enough to get to the BIOS screen). Perhaps a loose heat sink, or lack of thermal compound between the CPU and heat sink would be enough to do what you are describing.