[Bug debuginfod/31103] periodically malloc_trim()

fche at redhat dot com sourceware-bugzilla@sourceware.org
Tue Mar 12 12:39:10 GMT 2024


https://sourceware.org/bugzilla/show_bug.cgi?id=31103

--- Comment #5 from Frank Ch. Eigler <fche at redhat dot com> ---
Yeah, not surprised that there are no leaks.  What this malloc_trim() and the
preceding sqlite3_db_release_memory() calls are supposed to do is to release
memory back to the operating system.  So perhaps a getrusage() call in between
could be informative.  i.e.:

   struct rusage pre,during,post;
   getrusage(RUSAGE_SELF, &pre);
   sqlite3_db_release_memory( ...);
   getrusage(RUSAGE_SELF, &during);
   malloc_trim();
   getrusage(RUSAGE_SELF, &post);

and then the ru_idrss value should show some decrease ... except on
linux, ru_idrss is not supplied by the kernel.  So instead something like
the VmSize or VmData fields in /proc/self/status, ugh?

-- 
You are receiving this mail because:
You are on the CC list for the bug.


More information about the Elfutils-devel mailing list