iPhone crash

If I leave YouTube on on my phone, I tend to wake up to the phone having crashed and my alarm not having gone off. Not sure if anyone else has experienced this problem or has a solution besides just closing it before you sleep.

iPhone crash
 
 
Q