[MDEV-30848] Memory leak in MariaDB 10.6 Created: 2023-03-14 Updated: 2023-11-28 Resolved: 2023-11-28 |
|
| Status: | Closed |
| Project: | MariaDB Server |
| Component/s: | Server |
| Affects Version/s: | 10.6.12 |
| Fix Version/s: | N/A |
| Type: | Bug | Priority: | Major |
| Reporter: | Miroslav Lachman | Assignee: | Unassigned |
| Resolution: | Cannot Reproduce | Votes: | 3 |
| Labels: | crash, performance, regression | ||
| Environment: |
FreeBSD 12.3-RELEASE-p10 amd64 GENERIC |
||
| Attachments: |
|
||||||||||||
| Issue Links: |
|
||||||||||||
| Description |
|
I already reported about "memory leaks" we have seen after upgrade from 10.3 to 10.6 in comments of bugs This machine has configuration where it can eat up max 17GB of memory (if this calculation is right and if there is 100 connections)
(is this calculation above right?) But even if there is no more than 5 connections (listed by SHOW PROCESSLIST or tool mytop) MariaDB eats more than 18GB and than was killed by OOM. Top usage taken 40 seconds before OOM kill
If I will take the maximum connections seen today = 14 * 164MB per thread + 1161 MB global it should not take more than 3.5GB! We see this behavior on other machines with MariaDB 10.6.12 too. The more RAM we add to the VM the more MariaDB uses and crashes often. What is the right way to identify what in MariaDB eats so much memory and not release it? (There are no long running persistent connections but periodic tasks running from cron) |
| Comments |
| Comment by Miroslav Lachman [ 2023-03-15 ] | |||
|
We added another 12GB of memory (34GB total), but MariaDB eats it all again and crashed 3 times today (killed by OOM).
When I last seen it before crash mariadbd uses 28GB of memory with just a 2 active connections listed by PROCESSLIST. Then it eats more memory and get killed. It is really out of defined limits. | |||
| Comment by Miroslav Lachman [ 2023-03-27 ] | |||
|
Nobody is interested in this serious regression bug? The machine has 46GB of RAM configured but MariaDB is still crashing each day with "out of memory". | |||
| Comment by Vincent Jancso [ 2023-04-26 ] | |||
|
We are also experiencing some memory leaks after upgrading from MariaDB 10.3 to 10.6.12 running on FreeBSD 12.4. | |||
| Comment by Daniel Black [ 2023-07-10 ] | |||
|
Can you try to enable the performance schema and the [instruments for memory](https://mariadb.com/kb/en/performance-schema-tables/)? https://mariadb.com/kb/en/memory-is-leaking/#performance-schema | |||
| Comment by Michael Widenius [ 2023-09-07 ] | |||
|
It would have helped a lot get information about where memory is used and what kind of queries where running. select * from information_schema.processlist; Could help in finding out what is wrong. Regarding the calculation of memory used, some of the variables can be used multiple times for a query. | |||
| Comment by Miroslav Lachman [ 2023-11-28 ] | |||
|
I am sorry for a long time without reply. Out problem was probably solved by upgrade to MariaDB 10.6.13. |