iMac is turning on but a few seconds later just turned off by itself
I have an iMac (Mid 2011) and a couple weeks ago it continiously turned off (restart) while I was working on it or while it was on sleeping mode. But since yesterday I tried to turn it on but a few seconds later just turned off by itself. The display just shows a white screen with apple logo.
If someone knows how to resolve this issue please let me know.
Thank you!
iMac (21.5-inch Mid 2011), OS X Mavericks (10.9), 12 GB Ram