Most devices hang because of the insufficient phone storage while some other may hung due to some mechanical problems.
I agree with you on that a certain virus is one cause for a phone to hang. It's what I experienced recently. I am thankful to Kaspersky. My phone no longer hangs.In some cases it could also be caused my virus. We tend to expose our phones to various harms when we come online or visit certain sites or download files from time to time.