filprofiler icon indicating copy to clipboard operation
filprofiler copied to clipboard

A way to differentiate missed allocations from profiling being disabled

Open itamarst opened this issue 4 years ago • 0 comments

Sometimes we get free() of address we don't recognize. It is currently hard to distinguish the following circumstances:

  1. Allocation wasn't added because tracking was off (explicitly, or due to startup).
  2. Allocation was never captured due to not overriding some allocation API (valloc() or something).
  3. A free() of bogus address due to a bug in application code.

One solution is to always track all allocations—but when profiling is disabled, record the allocations with size 0. As a result they won't affect outcomes of profiling, but we will at least know those allocations existed.

itamarst avatar Apr 22 '21 11:04 itamarst