Android Lollipop (versions 5.0 - 5.1) contains several memory issues (leaks).
The phone memory (system memory and/or app memory) becomes higher as you are using the phone.
When there is not enough memory available to start an app, the phone may become slow.
In some cases, it will decide to suddenly close an app. This may be an essential app, such as the home screen.
Google is aware of the memory issues and working on fixes. For some memory related issues there may already be a fix available in the newest software release.
Make sure that your software version is up-to-date. (Apps > Settings > About phone > System updates (G3: Update Center > Software upedate. Downloading over Wi-Fi is preferred over a mobile data connection)
A temporary solution may be to restart the phone from time to time.
Another temporary solution may be to clear the running apps. (multitask button > swipe away apps (G3 also has the option 'Clear all')