diff options
author | monty@mashka.mysql.fi <> | 2003-10-13 15:50:30 +0300 |
---|---|---|
committer | monty@mashka.mysql.fi <> | 2003-10-13 15:50:30 +0300 |
commit | 461d1627b3323935345b13fe523f93dc74de9f36 (patch) | |
tree | 9b5d0d5098c97ae49c22be860572ba78e7471faa /sql/sql_test.cc | |
parent | c60a75e9ba08cd1937e73a42ca065b992a4f47d2 (diff) | |
parent | c95d142f8f602b717c6c10d13e37b2b3ecf069d4 (diff) | |
download | mariadb-git-461d1627b3323935345b13fe523f93dc74de9f36.tar.gz |
merge with 4.0 for more memory allocation variables.
Diffstat (limited to 'sql/sql_test.cc')
-rw-r--r-- | sql/sql_test.cc | 27 |
1 files changed, 27 insertions, 0 deletions
diff --git a/sql/sql_test.cc b/sql/sql_test.cc index f991a09398b..5a2b8ec86e5 100644 --- a/sql/sql_test.cc +++ b/sql/sql_test.cc @@ -22,6 +22,7 @@ #include "sql_select.h" #include <hash.h> #include <thr_alarm.h> +#include <malloc.h> /* Intern key cache variables */ extern "C" pthread_mutex_t THR_LOCK_keycache; @@ -365,6 +366,32 @@ Next alarm time: %lu\n", thd->proc_info="malloc"; my_checkmalloc(); TERMINATE(stdout); // Write malloc information + +#ifdef HAVE_MALLINFO + struct mallinfo info= mallinfo(); + printf("\nMemory status:\n\ +Non-mmapped space allocated from system: %d\n\ +Number of free chunks: %d\n\ +Number of fastbin blocks: %d\n\ +Number of mmapped regions: %d\n\ +Space in mmapped regions: %d\n\ +Maximum total allocated space: %d\n\ +Space available in freed fastbin blocks: %d\n\ +Total allocated space: %d\n\ +Total free space: %d\n\ +Top-most, releasable space: %d\n", + (int) info.arena, + (int) info.ordblks, + (int) info.smblks, + (int) info.hblks, + (int) info.hblkhd, + (int) info.usmblks, + (int) info.fsmblks, + (int) info.uordblks, + (int) info.fordblks, + (int) info.keepcost); +#endif + puts(""); if (thd) thd->proc_info=0; } |