easy_profiler
easy_profiler copied to clipboard
BlocksList::clearClosed() does not call clear() for chunk_allocator
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 thanks a lot for investigation!