gpt4 book ai didi

android - 谷歌地图 V2 和 HTC Wildfire S : Outofmemory error

转载 作者:太空狗 更新时间:2023-10-29 14:20:14 27 4
gpt4 key购买 nike

我的应用程序使用 Google map V2。在其他设备上一切正常,但是当我在 HTC Wildfire S 上打开 map Activity 时,在 map 导航几分钟后,我收到此错误:

07-23 18:16:08.556: E/AndroidRuntime(3316): FATAL EXCEPTION: vts_com.fedrasoft.craiinforma
07-23 18:16:08.556: E/AndroidRuntime(3316): java.lang.OutOfMemoryError: (Heap Size=16071KB, Allocated=11771KB, Bitmap Size=4445KB)
07-23 18:16:08.556: E/AndroidRuntime(3316): at maps.ap.d.a(Unknown Source)
07-23 18:16:08.556: E/AndroidRuntime(3316): at maps.i.ct.a(Unknown Source)
07-23 18:16:08.556: E/AndroidRuntime(3316): at maps.k.ah.a(Unknown Source)
07-23 18:16:08.556: E/AndroidRuntime(3316): at maps.k.d.a(Unknown Source)
07-23 18:16:08.556: E/AndroidRuntime(3316): at maps.k.g.handleMessage(Unknown Source)
07-23 18:16:08.556: E/AndroidRuntime(3316): at android.os.Handler.dispatchMessage(Handler.java:99)
07-23 18:16:08.556: E/AndroidRuntime(3316): at android.os.Looper.loop(Looper.java:150)
07-23 18:16:08.556: E/AndroidRuntime(3316): at maps.k.d.b(Unknown Source)
07-23 18:16:08.556: E/AndroidRuntime(3316): at maps.k.ag.b(Unknown Source)
07-23 18:16:08.556: E/AndroidRuntime(3316): at maps.ap.b.run(Unknown Source)
07-23 18:16:09.427: E/dalvikvm-heap(3316): Out of memory on a 25862-byte allocation.
07-23 18:16:09.437: E/dalvikvm(3316): Out of memory: Heap Size=16071KB, Allocated=11768KB, Bitmap Size=4445KB, Limit=20480KB
07-23 18:16:09.437: E/dalvikvm(3316): Extra info: Footprint=16071KB, Allowed Footprint=16071KB, Trimmed=1172KB
07-23 18:16:10.248: E/dalvikvm-heap(3316): Out of memory on a 25058-byte allocation.
07-23 18:16:10.258: E/dalvikvm(3316): Out of memory: Heap Size=16071KB, Allocated=11779KB, Bitmap Size=4445KB, Limit=20480KB
07-23 18:16:10.258: E/dalvikvm(3316): Extra info: Footprint=16071KB, Allowed Footprint=16071KB, Trimmed=1172KB
07-23 18:16:10.919: E/dalvikvm-heap(3316): Out of memory on a 38575-byte allocation.
07-23 18:16:10.929: E/dalvikvm(3316): Out of memory: Heap Size=16071KB, Allocated=11789KB, Bitmap Size=4445KB, Limit=20480KB
07-23 18:16:10.929: E/dalvikvm(3316): Extra info: Footprint=16071KB, Allowed Footprint=16071KB, Trimmed=1172KB
07-23 18:16:11.659: E/dalvikvm-heap(3316): Out of memory on a 25050-byte allocation.
07-23 18:16:11.669: E/dalvikvm(3316): Out of memory: Heap Size=16071KB, Allocated=11763KB, Bitmap Size=4445KB, Limit=20480KB
07-23 18:16:11.669: E/dalvikvm(3316): Extra info: Footprint=16071KB, Allowed Footprint=16071KB, Trimmed=1172KB
07-23 18:16:12.020: E/dalvikvm-heap(3316): Out of memory on a 25862-byte allocation.
07-23 18:16:12.030: E/dalvikvm(3316): Out of memory: Heap Size=16071KB, Allocated=11765KB, Bitmap Size=4445KB, Limit=20480KB
07-23 18:16:12.030: E/dalvikvm(3316): Extra info: Footprint=16071KB, Allowed Footprint=16071KB, Trimmed=1172KB
07-23 18:16:12.791: E/dalvikvm-heap(3316): Out of memory on a 38575-byte allocation.
07-23 18:16:12.801: E/dalvikvm(3316): Out of memory: Heap Size=16071KB, Allocated=11774KB, Bitmap Size=4445KB, Limit=20480KB
07-23 18:16:12.801: E/dalvikvm(3316): Extra info: Footprint=16071KB, Allowed Footprint=16071KB, Trimmed=1172KB
07-23 18:16:13.681: E/dalvikvm-heap(3316): Out of memory on a 25862-byte allocation.
07-23 18:16:13.691: E/dalvikvm(3316): Out of memory: Heap Size=16071KB, Allocated=11773KB, Bitmap Size=4445KB, Limit=20480KB
07-23 18:16:13.691: E/dalvikvm(3316): Extra info: Footprint=16071KB, Allowed Footprint=16071KB, Trimmed=1172KB
07-23 18:16:14.232: E/dalvikvm-heap(3316): Out of memory on a 25058-byte allocation.
07-23 18:16:14.242: E/dalvikvm(3316): Out of memory: Heap Size=16071KB, Allocated=11768KB, Bitmap Size=4445KB, Limit=20480KB
07-23 18:16:14.242: E/dalvikvm(3316): Extra info: Footprint=16071KB, Allowed Footprint=16071KB, Trimmed=1172KB
07-23 18:16:14.973: E/dalvikvm-heap(3316): Out of memory on a 38575-byte allocation.
07-23 18:16:14.983: E/dalvikvm(3316): Out of memory: Heap Size=16071KB, Allocated=11781KB, Bitmap Size=4445KB, Limit=20480KB
07-23 18:16:14.983: E/dalvikvm(3316): Extra info: Footprint=16071KB, Allowed Footprint=16071KB, Trimmed=1172KB
07-23 18:16:15.333: E/dalvikvm-heap(3316): Out of memory on a 25854-byte allocation.
07-23 18:16:15.343: E/dalvikvm(3316): Out of memory: Heap Size=16071KB, Allocated=11778KB, Bitmap Size=4445KB, Limit=20480KB
07-23 18:16:15.343: E/dalvikvm(3316): Extra info: Footprint=16071KB, Allowed Footprint=16071KB, Trimmed=1172KB

我的 map 上有数百个标记,这会占用内存吗?

最佳答案

我没有要检查的 Wildfire S,但我想如果你添加这个:

Toast.makeText(this, String.valueOf((Runtime.getRuntime().maxMemory() / 1024 / 1024)),
Toast.LENGTH_SHORT).show();

在您的应用程序开头的某个位置并在设备上运行它,toast 将显示 16。这是您的应用程序可以分配的最大堆,以 MB 为单位。可能您的其他测试设备有不同的限制。例如,我的 Desire HD(运行 PACman JellyBean)的限制是 48MB。对于 AVD,可以将此限制设置为配置的一部分。在某些情况下可以覆盖此限制,并且 How to increase heap size of an android application?提供了一些很好的信息。

您是否需要那么多的 Ram 是另一个问题,如果没有更多关于代码和设计的信息,我们无法推测。但是,看看最近的问题 android maps, markers and memory leaks .

最后,如果所有这些对您来说都是新的,那么仍然值得观看 Google IO 2011 演示文稿:Memory Management for Android Apps.

关于android - 谷歌地图 V2 和 HTC Wildfire S : Outofmemory error,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/17815740/

27 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com