mimalloc icon indicating copy to clipboard operation
mimalloc copied to clipboard

memory leak in mi_thread_data_zalloc

Open yushroom opened this issue 2 years ago • 2 comments

td->memid will be cleared by _mi_memzero_aligned before the function returns. So that td will not be correctly freed in mi_thread_data_free.

yushroom avatar May 19 '23 10:05 yushroom

Yikes! Thanks for the report -- I just pushed a fix.

daanx avatar May 19 '23 16:05 daanx

Recently, I tested alloc-test with mimalloc-v1.8.2, also notice memory leak for multi-thread, then I checkout to dev branch which has this issue addressed, the test result seem ok now. FYI I attached some results, the test just make alloc-test main() as a loop forever, each round we could get the (RSS max<<12)/allocatedMax。I hope someone knowing what I am talking about.... and I hope it is helpful

mimalloc-v1.8.2: image

mimalloc-dev: image

mashoujiang avatar Jul 14 '23 02:07 mashoujiang