filprofiler icon indicating copy to clipboard operation
filprofiler copied to clipboard

Shrink memory overhead of allocation tracking map

Open itamarst opened this issue 4 years ago • 0 comments

Right now there is a mapping from memory address to callstack ID + allocation size, for every single allocation. This uses a bunch of memory.

Some ways to shrink the keys:

  • BTree. Originally thought this slowed things down, but it might not on real workloads? Need to check.
  • PGM index, which promises much smaller indexes. Even if it is slower than hashmap, extra small memory usage might reduce performance hit from cache misses.

Some ways to shrink the values:

  • Omit allocation size; technically malloc_usable_size()/malloc_size() can give this, but that has performance hit...
  • Reduce number of callstack IDs?
  • Reduce bits for allocation size? Some sort of 24-bit floating point might work, for example.

itamarst avatar Jan 25 '21 13:01 itamarst