google maps api v2 out of memory error

前端 未结 2 728
盖世英雄少女心
盖世英雄少女心 2021-02-05 10:22

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(

相关标签:
2条回答
  • Alright... I think this should work...

    Add googleMap.clear() whenever you want to reset the map.

    Hope this will help you.

    0 讨论(0)
  • 2021-02-05 11:11

    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">
    
    0 讨论(0)
提交回复
热议问题