谷歌地图 - 内存不足异常 [英] Google Maps - Out of memory exception

查看:3189
本文介绍了谷歌地图 - 内存不足异常的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我使用谷歌地图V2和我得到以下错误:

I am using Google Maps v2 and am getting following error:

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)

应用程序不崩溃呢,但地图不再显示。当我加载再次包含地图的活动,应用程序显示一个警告,并出现以下错误消息崩溃:

The app doesn't crash yet, but the map isn't shown anymore. When I load the activity that contains the map again, the app shows a warning and crashes with the following error message:

警告:

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

我想问题可能是自定义图标的用法:

I think the problem might be the usage of custom icons:

googleMap.addMarker(new MarkerOptions()
 .position(chargingStationObject.geoData)
 .title(chargingStationObject.name)
 .snippet(chargingStationObject.stationAvailability)
 .data((chargingStationObject.id))
 .icon(iconDescriptor_gray));

有没有办法牛逼prevent这种情况发生?使用较小的位图的图标,例如?

Is there a way t prevent that from happening? Using smaller bitmaps for icons, for example?

推荐答案

一样的解决方法,我添加的 largeHeap = TRUE 到AndroidManifest.xml中。这似乎是工作,我想一个更优雅的解决方案,但是。

As as workaround I added largeHeap=true to the AndroidManifest.xml. It seems to be working, I'd like a more elegant solution however.

这篇关于谷歌地图 - 内存不足异常的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆