easy_profiler icon indicating copy to clipboard operation
easy_profiler copied to clipboard

BlocksList::clearClosed() does not call clear() for chunk_allocator

Open tkalbitz opened this issue 5 years ago • 1 comments

When captured blocks are dumped ThreadStorage::clearClosed() is called to free up memory from the already dumped blocks. The function delegates the task to two instance of struct BlocksList via BlockList::clearClosed().

To free the memory clear() must be called on chunk_allocator. This is commented out. This was introduce in a refactoring commit from September 2017.

The memory is not reused and will grow each time the capturing is started instead of reusing already dumped profiling data. When clear() is called the behavior as expected. Memory will be freed and no further grow is visible. I did test this on a Linux x86_64 without testing for race conditions or undefined behavior via sanitizer.

tkalbitz avatar Feb 23 '19 11:02 tkalbitz

@tkalbitz thanks a lot for investigation!

cas4ey avatar Feb 25 '19 13:02 cas4ey