Is that because your phone has not enough memory, so once it goes to lock screen and become background job, whatsapp in your mobile has been terminated. So you need to manually turn on the screen and activate whatsapp back to foreground again.
I am using G4, most of the time keep connected even in lock screen mode. (Just a few times have the same issue like u)