In my application, I'm careful not to make heap allocations in the main render loop, to prevent the garbage collector from having to do its thing.
After making a series of changes to my application, I suddenly see the garbage collector getting invoked every second or two, and it is freeing up around 400k of memory per invocation.
I look back at the changes that I made, and I don't have any explicit allocations happening on the render thread. So I run ddms and use the "Allocation Tracker" tool, but there are no allocations happening, other than the normal ones that are related to running ddms. And certainly not enough allocations shown for the 400k bytes that are apparently being garbage collected every second or so
See Question&Answers more detail:
os 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…