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().
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.
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 ofstruct BlocksList
viaBlockList::clearClosed()
.To free the memory
clear()
must be called onchunk_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.