Diagnosing iMac hard crashes
You could try testing the hard drive with Smart Utility, but it sounds like to me that it is your Ram that you installed. I have personal experience with bad/incompatible ram and the symptoms you are describing are exactly what happens if the ram is the aforementioned.