本文主要是介绍Logcat 总提示D/dalvikvm : GC_FOR_ALLOC freed,希望对大家解决编程问题提供一定的参考价值,需要的开发者们随着小编来一起学习吧!
出现这总情况一般是界面不停的加载和释放图片的原因。12-07 08:15:18.514: D/dalvikvm(19719): GC_FOR_ALLOC freed 921K (22), 34% free 4222K/6332K, paused 20ms, total 20ms 12-07 08:15:18.532: D/skia(19719): Flag is not 10 12-07 08:15:18.813: D/dalvikvm(19719): GC_FOR_ALLOC freed 921K (23), 34% free 4222K/6332K, paused 24ms, total 24ms 12-07 08:15:18.859: D/skia(19719): Flag is not 10 12-07 08:15:19.148: D/dalvikvm(19719): GC_FOR_ALLOC freed 921K (20), 34% free 4222K/6332K, paused 27ms, total 27ms 12-07 08:15:19.169: D/skia(19719): Flag is not 10 12-07 08:15:19.450: D/dalvikvm(19719): GC_FOR_ALLOC freed 921K (22), 34% free 4222K/6332K, paused 24ms, total 24ms 12-07 08:15:19.494: D/skia(19719): Flag is not 10 12-07 08:15:19.780: D/dalvikvm(19719): GC_FOR_ALLOC freed 921K (23), 34% free 4222K/6332K, paused 24ms, total 24ms
这是我开机用换图的方式实现开机动画。用一个handler+runnable和图片资源数组实现的。本以为在activity退出的时候会自动停止,现在才发现它不会停……所以在activity结束的时候,把runnable从handler移除即可。mImgLogo.setBackgroundResource(logo_res[mLogoIndex]);
之后Logcat就没出现不停打印 D/dalvikvm : GC_FOR_ALLOC freed 之类的信息了。@Override protected void onDestroy() {mHandler.removeCallbacks(mChangeLogoRunnable);super.onDestroy(); }
这篇关于Logcat 总提示D/dalvikvm : GC_FOR_ALLOC freed的文章就介绍到这儿,希望我们推荐的文章对编程师们有所帮助!