Warning: file_get_contents(/data/phpspider/zhask/data//catemap/3/android/180.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181

Warning: file_get_contents(/data/phpspider/zhask/data//catemap/7/google-maps/4.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Android 谷歌地图-内存不足异常_Android_Google Maps_Out Of Memory_Fatal Error - Fatal编程技术网

Android 谷歌地图-内存不足异常

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

我正在使用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/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));