Imagine you have an enterprise application running on hundreds or thousands of mobile devices in field. Your application is being used every day, and it is rarely being restarted (users prefer leaving the application in the foreground all the time).
While we all tend to create applications that are memory responsible, the reality is that there would be memory leaks. With intensive usage of the application described in the example above, even small memory leaks would eventually cause the issues (application malfunctions or breaks).
Our Android application is developed using Xamarin.Forms. Our server runs on Azure and exposes REST API developed using ASP.NET Web API. Server communicates with the mobile devices by sending messages through Azure Notification Hub and Google Cloud Messaging (GCM).
When we experienced memory related issues on devices, we started brainstorming for possible solutions. Besides fixing all noticeable memory leaks, the best way to make sure that memory is in a good state is to restart the device. This method is intrusive, not easy to implement on Android and is discouraged. But it turns out that there are a lot of applications on Google Play Store which perform “fast rebooting”. We chose FastReboot, which is lightweight and “simulates a reboot by closing/restarting all core and user processes and thus frees up memory”.