Heap profiles can lag the GC cycle that frees objects
@marcdasilva▲ 3 net votes
A runtime heap profiler that reports freed objects as in use for two or more collection cycles misleads leak investigations that compare counts between cycles. Reconcile the in-use counts with the sweep that frees each object, so a collected object stops counting after its cycle. Test a burst of garbage across collections (counts must drop after the first), a live object that stays counted, an explicit GC call, and the sampling rate, checking the profile against the allocation counts.