There have been a number of out of memory issues occuring on Android affecting users with lower spec Android devices (~1.5GB RAM) These crashes have occured on the events screen and also the parade screen. I've profiled the memory usage and discussed with @RGBboy and there's a couple of different issues.
Images loaded from Contentful are not optimised
The events page loads the orginal size of the image from Contentful and then rescales. This is a perfomance issue because these bitmaps can be large. Contentful API allows to request a specific size of image, we can use this to avoid creating bitmaps get down scaled for rendering.
Google Maps Memory Usage Spike
Google Maps uses additional memory when it is first opened and garbage collection does not occur instantly when switching tabs. This means when switching between Events and Parade for a moment memory usage can exceed the ~100MB allocated on these lower end devices.
Potential Solution
I think that optimising the use of Contentful is the most impactful memory optimisation we could make at this time, and by reducing the memory usage on the Events page we will reduce the occurance of Out of Memory on the Parade screen.
Steps to reproduce
Attach to the Android Studio perfomance profiler, double click on the memory graph (That smaller version of the graph uses a lower sample rate which doesn't show the behaviour I've described as clearly) scroll the Events screen, switch between Parade screen and Events screen to observe that peak memory usage is high whilst switching tabs.
I haven't been able to observe the Out of Memory issue itself. The device I was testing on didn't have many competing processes so likely allocated more Java Virtual Machine heap space.
Description of issue
There have been a number of out of memory issues occuring on Android affecting users with lower spec Android devices (~1.5GB RAM) These crashes have occured on the events screen and also the parade screen. I've profiled the memory usage and discussed with @RGBboy and there's a couple of different issues.
Images loaded from Contentful are not optimised
The events page loads the orginal size of the image from Contentful and then rescales. This is a perfomance issue because these bitmaps can be large. Contentful API allows to request a specific size of image, we can use this to avoid creating bitmaps get down scaled for rendering.
Google Maps Memory Usage Spike
Google Maps uses additional memory when it is first opened and garbage collection does not occur instantly when switching tabs. This means when switching between Events and Parade for a moment memory usage can exceed the ~100MB allocated on these lower end devices.
Potential Solution
I think that optimising the use of Contentful is the most impactful memory optimisation we could make at this time, and by reducing the memory usage on the Events page we will reduce the occurance of Out of Memory on the Parade screen.
Steps to reproduce
Attach to the Android Studio perfomance profiler, double click on the memory graph (That smaller version of the graph uses a lower sample rate which doesn't show the behaviour I've described as clearly) scroll the Events screen, switch between Parade screen and Events screen to observe that peak memory usage is high whilst switching tabs.
I haven't been able to observe the Out of Memory issue itself. The device I was testing on didn't have many competing processes so likely allocated more Java Virtual Machine heap space.
OS / Browser / Device model
Android Devices which have 1.5GB RAM or less