Good questions by Szy! To me it really sounds more like hardware related issue, could be that the CPU or something else overheats and that might cause the shutdown.
Faulty memory is one thing, there are programs to test the RAM in your computer.
Consider as well what you might have installed lately or if some updates haven't gone through correctly. (This is just guessing you're using Windows OS.)
Think of the questions by Szy, all the best to you!
And one thing to question, where's is your computer placed, maybe there is some dust inside that might cause bad airflow. Just one of the possibilities.
I remember silly IBM computers which had buggy motherboards and to get them to work again, you just had to remove the RAM and put it back again, a weird memory buildup.