summaryrefslogtreecommitdiff
path: root/sql/sql_test.cc
diff options
context:
space:
mode:
authormonty@mashka.mysql.fi <>2003-10-11 22:00:24 +0300
committermonty@mashka.mysql.fi <>2003-10-11 22:00:24 +0300
commitc95d142f8f602b717c6c10d13e37b2b3ecf069d4 (patch)
tree50a7bfd87153439907087d4b3529d622cfc75313 /sql/sql_test.cc
parent9bba878b8c6b6abd9be97a9d5a6c89bda8762693 (diff)
downloadmariadb-git-c95d142f8f602b717c6c10d13e37b2b3ecf069d4.tar.gz
Add new user variables for tuning memory usage:
query_alloc_block_size, query_prealloc_size, range_alloc_block_size,transaction_alloc_block_size and transaction_prealloc_size Add more checks for "out of memory" detection in range optimization
Diffstat (limited to 'sql/sql_test.cc')
-rw-r--r--sql/sql_test.cc27
1 files changed, 27 insertions, 0 deletions
diff --git a/sql/sql_test.cc b/sql/sql_test.cc
index 6816bb62047..fc3147db784 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;
@@ -257,6 +258,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;
}