Android 谷歌地图-内存不足异常
我正在使用Google Maps v2,出现以下错误:Android 谷歌地图-内存不足异常,android,google-maps,out-of-memory,fatal-error,Android,Google Maps,Out Of Memory,Fatal Error,我正在使用Google Maps v2,出现以下错误: E/qdmemalloc(17414): ion: Failed to map memory in the client: Out of memory E/qdgralloc(17414): Could not mmap handle 0x7e55bf40, fd=143 (Out of memory) E/qdgralloc(17414): gralloc_register_buffer: gralloc_map failed E/Gra
E/qdmemalloc(17414): ion: Failed to map memory in the client: Out of memory
E/qdgralloc(17414): Could not mmap handle 0x7e55bf40, fd=143 (Out of memory)
E/qdgralloc(17414): gralloc_register_buffer: gralloc_map failed
E/GraphicBuffer(17414): unflatten: registerBuffer failed: Out of memory (-12)
应用程序尚未崩溃,但地图不再显示。当我再次加载包含地图的活动时,应用程序会显示警告并崩溃,并显示以下错误消息:
警告:
<sharedmem_gpumem_alloc_id:1431>: sharedmem_gpumem_alloc:
mmap failed errno 12 Out of memory
有没有办法阻止这种情况发生?例如,使用较小的图标位图作为解决方法,我在AndroidManifest.xml中添加了largeHeap=true。这似乎是工作,但我想要一个更优雅的解决方案
<ioctl_kgsl_sharedmem_alloc:1532>:
ioctl_kgsl_sharedmem_alloc: FATAL ERROR : (null)
googleMap.addMarker(new MarkerOptions()
.position(chargingStationObject.geoData)
.title(chargingStationObject.name)
.snippet(chargingStationObject.stationAvailability)
.data((chargingStationObject.id))
.icon(iconDescriptor_gray));