i have a huge memory problem in my app. i am using google map api v2 with ClusterManager
and custom markers. i supply an image via call to markerOptions.icon(
Alright... I think this should work...
Add googleMap.clear()
whenever you want to reset the map.
Hope this will help you.
I ran into this problem trying to run an app on demo mode for a few hours at a time. No matter what I tried, after 30 minutes, I would see this crash without a readable stack report.
I tried System gc(), detaching the fragment, singleton activities, updating google play services to the latest, clearing references to overlays, attaching map lifecycle to activity and what not. After many failed attempts and a lot of frustration I finally found something that worked. It's not a fix for the map bug, but it kept my app from crashing:
<application
...
android:largeHeap="true">