How to track size of malloc internal caches?

Anton Zyablitskiy antonorigon@gmail.com
Mon Jul 27 12:31:55 GMT 2020


Hi Glibc team,

I have a slow memory depletion (100-300 kb per hour) on my long running
highly multithreaded app and suspect allocator internal caches or
fragmentation. By internal caches I understand those memory which was freed
by application but kept by malloc for later use. I need a way to prove or
disprove this.
I collected malloc_info output over certain time intervals but it is hard
to understand.
Could you please point me to numbers I should look at? Maybe there are some
aggregate numbers like 'total allocated from os' or 'total in use by
application'?
If it possible it is preferred to use something other than malloc_info
because it crashes my app with "*Bug 22408* - malloc_info access heaps
without arena lock, ignores heaps"
I use glibc 2.23 on a 64-bit linux system.

Thank you!
-AntonZ


More information about the Libc-help mailing list