Discover memory analysis tools ready for use also on production code
It seems useful to have integrated mem. analysis tool in production build and then activate it at runtime i.e. by calling some function from attached debugger level.
Good candidate seems to be TCMalloc offering some API to analyze allocations, dump heaps like also optimizing memory usage for small allocations:
https://github.com/google/tcmalloc
Example of function call performed from debugger level: sudo gdb --batch-silent --ex='print malloc_trim(0)' -p $(pidof hived)