Edit: added PSU.
Recently I started getting BSOD's randomly with the error code Memory Management. I replaced the faulty RAM and the BSOD's no longer appeared.
However, now I get these red, green, blue and white flashes while playing games.
Some games I've tested;
Risk of Rain 2