It could be related to an app you installed, you could have something wrong with a system file, or you could have a defective unit. I'd probably recommend a factory reset unless you want to uninstall possible culprit apps one by one and test. If it keeps happening after a factory reset then exchange it.
Sent from my LG G2 via Tapatalk