optimize flamegraph generation for allocations