I am experiencing very high memory usage on MariaDB server. I am not sure if it is due to misconfiguration or a bug.
Server: MariaDB
Server version: 10.5.4-MariaDB MariaDB Server
We are running MariaDB 10.5.4
Our server is configured to use 140G for bugger and 9G for log.
innodb_buffer_pool_size=140G
innodb_log_file_size=9G
max_heap_table_size = 8G
tmp_table_size = 8G
However, our server is currently using 225G without any load on server, and frequently spikes over 240G during queries.
All tables are InnoDB. Memory buffer usage according to information schema is the following:
MariaDB [db]> SELECT ENGINE, ROUND(SUM(data_length) /1024/1024, 1) AS "Data MB", ROUND(SUM(index_length)/1024/1024, 1) AS "Index MB", ROUND(SUM(data_length + index_length)/1024/1024, 1) AS "Total MB", COUNT(*) "Num Tables" FROM INFORMATION_SCHEMA.TABLES WHERE table_schema not in ("information_schema", "PERFORMANCE_SCHEMA", "SYS_SCHEMA", "ndbinfo") GROUP BY ENGINE;
+--------+-----------+----------+-----------+------------+
| ENGINE | Data MB | Index MB | Total MB | Num Tables |
+--------+-----------+----------+-----------+------------+
| NULL | NULL | NULL | NULL | 20 |
| Aria | 0.8 | 0.3 | 1.1 | 24 |
| CSV | 0.0 | 0.0 | 0.0 | 2 |
| InnoDB | 1952761.3 | 284144.6 | 2236905.9 | 2517 |
| MEMORY | 0.0 | 0.0 | 0.0 | 3 |
+--------+-----------+----------+-----------+------------+
Total large memory allocated 151397597184
Dictionary memory allocated 899109080
Buffer pool size 9019360
Free buffers 1024
Database pages 9018336
Old database pages 3329014
Modified db pages 0
Percent of dirty pages(LRU & free pages): 0.000
Max dirty pages percent: 75.000
Pending reads 0
Pending writes: LRU 0, flush list 0, single page 0
Pages made young 47473690, not young 10534657191
0.00 youngs/s, 0.00 non-youngs/s
Pages read 192376965, created 62530810, written 146872114
0.00 reads/s, 0.00 creates/s, 0.00 writes/s
No buffer pool page gets since the last printout
Pages read ahead 0.00/s, evicted without access 0.00/s, Random read ahead 0.00/s
LRU len: 9018336, unzip_LRU len: 0
I/O sum[0]:cur[0], unzip sum[0]:cur[0]
Server memory usage starts out normally, but greatly increases during couple days until it eventually consumes all of server's resources and restarts.
We began experiencing this issue shortly after upgrading from an ancient version of MariaDB. (do not recall which one, but it was very dated).
How can I troubleshoot this issue further, and what can I do to ensure that memory usage does not go above 160G?