In the last couple of weeks, my late 2015 27" 395X 32Gb RAM 4GHz i7 iMac is just shutting down on me regularly.
This happens in Windows bootcamp as well as macOS, and is always when I am playing demanding games, e.g. Deus Ex Mankind Divided, DCS, etc.
I am vey concerned that this is due to overheating. See attached graph from iStat. Through the period of this graph, I was playing Deus Ex MD. The dips are where the iMac went to sleep!
Any thoughts on this?
View attachment 747170
High CPU / GPU temperature is normal on the iMac unfortunately. Is that right? There is no right or wrong, but Apple choose form factor over cooling, and Apple users love this path. However, it seems most iMac seems can survive for a reasonable period of time even Apple let the chips run right at their official limit temperature.
So, is the temperature a problem? It may be somehow related, but hard to conclude that's the root cause of the shutdown. Since you mentioned it's 2015 machine, is your place dusty? Did you ever clear the dust? The GPU can survive at high temperature, but still need an effective cooling system to support. Pure thermal throttling cannot completely avoid thermal shutdown. So, if your cooling system is dusty, the temperature will be very hard to go down. Even thermal throttling can avoid sudden super high temperature, but the accumulated heat can still causing the GPU overheat (especially when the GPU under stress for a period of time)
If you have compressed air / blower / duster... I suggest you can try to apply compressed air from the exhaust (of course, when the iMac is shut down), try to blow the duty out from the intake. I didn't own an iMac now, but this trick work for all my other electronics (PS4, XB1, Mac Pro, graphic cards, etc). Just apply compressed air back and forth few times. It can usually blow out most of the dust and recover most cooling ability. Of course, open it up is the best way to deep clean it. But I won't recommend any user to do that on an iMac unless they really know what they are doing.
And since you said it happened in both OS. Then it effectively rule out software issue, but pointing to hardware issue.
Of course, in worst case, the damage is already done. So, no matter what you do, the damaged GPU / CPU / VRAM (or the electronics around them) may still shutdown the Mac at anytime. Then you should bring it back to Apple, let them diagnosis, and fix it.