Assuming you follow the suggestions above, and it still does not improve...
You might want to open up the computer and check to see that everything is solidly connected. You RAM is obviously working, but it may not be firmly sitting in it's socket.
Also check to see if the heatsink is attached correctly. It could be an issue of overheating. Since you are using OSX, open up the CPU Monitor in the Utilities folder, and set it up to display on the side of your monitor. If it is constantly peaking out even at idle, there might be a hardware issue.
And if the computer is still under warrantee, call Apple and have them check it out.