mimalloc icon indicating copy to clipboard operation
mimalloc copied to clipboard

help me understand mi_stats_print_out

Open yushizhao opened this issue 2 years ago • 2 comments

I am using mimalloc in a muti-thread app and want to monitor its memory usage. I find mi_stats_print_out in the doc , however, without much description on what it prints. After some experiments, I have several basic questions: 1 what reserved, committed and touched means? 2 what total means? Sometimes, I see total is greater than peak. 3 In the row "touched", why freed can be greater than total, so that I see a negative current? 4 there is also a mi_thread_ stats_print_out, is mi_stats_print_out a merged result of all threads? 5 If I want to know the size of memory that is in use, I mean new()-ed but not free()-ed, across the process, which number should I use? Thanks!

yushizhao avatar May 09 '23 10:05 yushizhao

It would also be really nice if there is a way to get the memory usage stat numbers programmatically rather than in a text message.

gozetor avatar Oct 04 '24 00:10 gozetor

Agree, like in #558

epoupon avatar Oct 04 '24 04:10 epoupon