This adds a mode argument to getmemoryinfo. By default the output will remain the same. However if a mode argument of mallocinfo is provided the result of glibc malloc_info (if available) will be returned as a string, as-is.
This output contains detailed malloc heap statistics, and is useful for tracking heap usage over time or troubleshooting memory fragmentation issues.
