Bad RAM wouldn't shut the PC off. As you already replaced the PSU, I'd guess either Overtemp or Motherboard.
open