How to view Garbage collector logs in android logcat
I need to view the Garbage Collector messages in logcat for the device. I dont get any messages with dalvik-vm tag in my logcat, when I am testing my app on device. But I get these messages when I am using an emulator. Are there any specific settings to enable dalvik-vm/garbage collector logging.
Logcat messages I get with the emulator 开发者_如何学JAVAand not with device:
07-06 13:37:05.816: DEBUG/dalvikvm(392): GC_EXTERNAL_ALLOC freed 830 objects / 60984 bytes in 134ms
07-06 13:37:06.476: DEBUG/dalvikvm(392): GC_EXTERNAL_ALLOC freed 138 objects / 180960 bytes in 141ms
07-06 13:37:09.016: DEBUG/dalvikvm(392): GC_EXPLICIT freed 27 objects / 1160 bytes in 56ms
Thanks in advance.
You could check the logs in logcat while debugging on your device to see what the tag is for those messages; on devices I have got, the tag is dalvikvm rather than dalvik-vm.
精彩评论