1
0
mirror of https://github.com/MariaDB/server.git synced 2025-08-01 03:47:19 +03:00

Merge 10.5 into 10.6

This commit is contained in:
Marko Mäkelä
2021-04-14 13:39:28 +03:00
5 changed files with 21 additions and 2 deletions

View File

@ -33,6 +33,8 @@
#include <malloc.h>
#elif defined(HAVE_MALLINFO) && defined(HAVE_SYS_MALLOC_H)
#include <sys/malloc.h>
#elif defined(HAVE_MALLOC_ZONE)
#include <malloc/malloc.h>
#endif
#ifdef HAVE_EVENT_SCHEDULER
@ -655,6 +657,20 @@ Memory allocated by threads: %s\n",
llstr(tmp.global_memory_used, llbuff[8]),
llstr(tmp.local_memory_used, llbuff[9]));
#elif defined(HAVE_MALLOC_ZONE)
malloc_statistics_t info;
char llbuff[4][22];
malloc_zone_statistics(nullptr, &info);
printf("\nMemory status:\n\
Total allocated space: %s\n\
Total free space: %s\n\
Global memory allocated by server: %s\n\
Memory allocated by threads: %s\n",
llstr(info.size_allocated, llbuff[0]),
llstr((info.size_allocated - info.size_in_use), llbuff[1]),
llstr(tmp.global_memory_used, llbuff[2]),
llstr(tmp.local_memory_used, llbuff[3]));
#endif
#ifdef HAVE_EVENT_SCHEDULER