Test the memory again with this:
http://www.memtest86.com/download.htmlDownload the "ISO image for creating bootable CD (Windows - zip)", burn it to a CD then boot the computer from that CD. Run the test and let it run for multiple passes (this will take hours, best to do it overnight). Errors won't always come on the first pass, sometimes they'll show up on the second, third, or later passes. If you get any errors, remove the RAM and make sure the contacts aren't corroded or dirty and the slot is clean, put it back in and run the test a second night. If the errors persist, the RAM is bad.
Run it with Ubuntu for a while and actively use it for a while (surf the web, watch videos, play music, whatever) and see if it gets an error or lucks up.
What did you use to diagnose the hard drive? If you didn't use the hard drive manufacturer's tool, download it and try it. They should be able to tell you better than anyone whether the drive is malfunctioning or not.
As for heat, download Speedfan:
http://www.almico.com/sfdownload.phpIt runs in Windows and will tell you the CPU and other temps.