diff options
author | Monty <monty@mariadb.org> | 2017-11-01 20:28:36 +0200 |
---|---|---|
committer | Monty <monty@mariadb.org> | 2017-11-02 20:37:25 +0200 |
commit | 9ec19b9b41804d8d4491f0f58ac06ae417e02ffa (patch) | |
tree | 91b175f8799056ae5bf1eed61d3917e374e7903f /include | |
parent | 2ec7b870531d70f3c7686af2d6bc2c33e7c23bc7 (diff) | |
download | mariadb-git-9ec19b9b41804d8d4491f0f58ac06ae417e02ffa.tar.gz |
Reducing memory when using information schema
The background is that one user had a lot of views and using some complex
queries on information schema temporary memory of more than 2G was used.
- Added new element 'total_alloc' to MEM_ROOT for easier debugging.
- Added MAX_MEMORY_USED to information_schema.processlist.
- Added new status variable "Memory_used_initial" that shows how much MariaDB
uses at startup. This gives the base value for "Memory_used".
- Reuse memory continuously for information schema queries instead of
only freeing memory at query end.
Other things
- Removed some not needed set_notnull() calls for not null columns.
Diffstat (limited to 'include')
-rw-r--r-- | include/my_alloc.h | 1 | ||||
-rw-r--r-- | include/mysql.h.pp | 1 |
2 files changed, 2 insertions, 0 deletions
diff --git a/include/my_alloc.h b/include/my_alloc.h index 85ac75fc666..b461065eb7c 100644 --- a/include/my_alloc.h +++ b/include/my_alloc.h @@ -43,6 +43,7 @@ typedef struct st_mem_root /* if block have less memory it will be put in 'used' list */ size_t min_malloc; size_t block_size; /* initial block size */ + size_t total_alloc; unsigned int block_num; /* allocated blocks counter */ /* first free block in queue test counter (if it exceed diff --git a/include/mysql.h.pp b/include/mysql.h.pp index d061df71944..e88738be779 100644 --- a/include/mysql.h.pp +++ b/include/mysql.h.pp @@ -236,6 +236,7 @@ typedef struct st_mem_root USED_MEM *pre_alloc; size_t min_malloc; size_t block_size; + size_t total_alloc; unsigned int block_num; unsigned int first_block_usage; void (*error_handler)(void); |