Android的气相色谱 - LogCat中始终显示GC活动 [英] Android GC - LogCat always showing GC activity

查看:92
本文介绍了Android的气相色谱 - LogCat中始终显示GC活动的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

当我运行我的程序,logcat中显示了很多活动,与GC

when i run my program, logcat shows a lot of activity with GC

喜欢

GC freed 10324 objects/ 510376 bytes in 103 ms
GC freed 10324 objects/ 510376 bytes in 103 ms
GC freed 10324 objects/ 510376 bytes in 103 ms
GC freed 10324 objects/ 510376 bytes in 103 ms
GC freed 10324 objects/ 510376 bytes in 103 ms

有差异的OBJ,字节和毫秒值...

with diff in obj, bytes and ms values...

因为编码的一些不好的做法呢?

is it because of some bad practice of coding ?

推荐答案

如果你的程序不必然需要配置许多对象,则是肯定的。否则,没有。如果你的程序需要运行得更快或者是比如一个游戏,需要运行在任何时候都顺利,那么你可以尝试重新使用对象,以更大的程度。

If your program dont necessarily needs to dispose of that many objects, then yes. Otherwise, no. If your program needs to run faster or is for example a game that needs to run smooth at all times, then you might try re-using objects to a greater extent.

这篇关于Android的气相色谱 - LogCat中始终显示GC活动的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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