【问题标题】:Google Maps - Out of memory exception谷歌地图 - 内存不足异常
【发布时间】:2014-10-21 16:24:32
【问题描述】:

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

错误:

<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));

有没有办法防止这种情况发生?例如,对图标使用较小的位图?

【问题讨论】:

    标签: android google-maps out-of-memory fatal-error


    【解决方案1】:

    作为解决方法,我将 largeHeap=true 添加到 AndroidManifest.xml。它似乎有效,但是我想要一个更优雅的解决方案。

    【讨论】:

      猜你喜欢
      • 2015-07-25
      • 2013-06-24
      • 1970-01-01
      • 1970-01-01
      • 2011-05-19
      • 2016-08-23
      • 1970-01-01
      • 2010-10-05
      相关资源
      最近更新 更多