本文介绍了等待阻塞并发GC的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

当我在模拟器上运行我的应用程序的logcat正显示出这一点:

When I run my application on emulator the Logcat is showing this:

04-22 16:21:30.685: D/dalvikvm(967): GC_CONCURRENT freed 1545K, 20% free 7019K/8720K, paused 78ms+17ms, total 360ms

04-22 16:21:30.685: D/dalvikvm(967): WAIT_FOR_CONCURRENT_GC blocked 143ms
04-22 16:21:31.845: D/dalvikvm(967): GC_CONCURRENT freed 1552K, 20% free 7019K/8720K, paused 116ms+18ms, total 554ms

04-22 16:21:31.845: D/dalvikvm(967): WAIT_FOR_CONCURRENT_GC blocked 268ms
04-22 16:21:32.435: D/dalvikvm(967): GC_CONCURRENT freed 1545K, 20% free 7019K/8720K, paused 75ms+9ms, total 192ms

04-22 16:21:32.435: D/dalvikvm(967): WAIT_FOR_CONCURRENT_GC blocked 73ms
04-22 16:21:32.945: D/dalvikvm(967): GC_CONCURRENT freed 1552K, 20% free 7019K/8720K, paused 75ms+10ms, total 209ms

04-22 16:21:32.945: D/dalvikvm(967): WAIT_FOR_CONCURRENT_GC blocked 70ms
04-22 16:21:33.434: D/dalvikvm(967): GC_CONCURRENT freed 1545K, 20% free 7019K/8720K, paused 78ms+12ms, total 192ms

和这样继续下去,直到我退出application.Any建议?谢谢

and this continues until I exit the application.Any suggestion?Thanks

推荐答案

好像你已经创造了许多新的对象,并很快扔掉。

Seems like you're creating many new objects and throw them away soon.

有关WAIT_FOR_CONCURRENT_GC看到这一个:
what不WAIT_FOR_CONCURRENT_GC阻塞呢?

For WAIT_FOR_CONCURRENT_GC see this one:what does WAIT_FOR_CONCURRENT_GC blocked mean?

这意味着你尝试分配存储器(例如对象的创建),它不适合到内存中。那是什么释放被GC_CONCURRENT所致。它只是平常的垃圾收集。

It means you try to allocate memory (for example object creation) and it doesn't fit into memory. Thats what GC_CONCURRENT freed is caused by. Its just usual garbage collection.

如果你有性能问题,尝试重用对象或放过他们。

If you've got performance problems, try to reuse objects or spare them.

这篇关于等待阻塞并发GC的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

08-30 05:33