This app was mentioned in 5 comments, with an average of 1.00 upvote
Yeah it happened with me too. But I found a fix. Try installing this app: https://play.google.com/store/apps/details?id=com.sash.sodeliminator
It fixed it for me. Hopefully it does for you too! Let me know how it goes.
I used Safe Charge on my Nexus 4 back when I had it to prevent the Sleep of Death while charging.
Once set up, it basically works by forcing a wake lock on the phone only while it's connected to power so that the phone CAN'T sleep. Any power management you have running will need to allow Safe Charge to use wakelocks as a result.
The only way for me to get rid of SODs (and trust me, I've tried a LOT) is this; it consumes ~2% battery/hour but at least the phone is reliable.
Not sure if you are referring to the sleep of death that occurs during charging, but this app took care of it for me. I found it ages ago and haven't had a SOD since.
https://play.google.com/store/apps/details?id=com.sash.sodeliminator&hl=en
Hmm, try this