Bug #113334 Mysql memory bloating and causing server out of memory
Submitted: 5 Dec 2023 8:32 Modified: 5 Dec 2023 10:38
Reporter: JASPAL SINGH Email Updates:
Status: Can't repeat Impact on me:
None 
Category:MySQL Server Severity:S2 (Serious)
Version:8.0.30 OS:Windows (2016)
Assigned to: CPU Architecture:Any (12 CPUs)
Tags: Out Of Memory error

[5 Dec 2023 8:32] JASPAL SINGH
Description:
We are receiving high memory usage alerts in our Application. 
We are using mysql version 8.0.30 and the server has 12 CPUs and 100GB of RAM, which is sized well for the the application.

-We have Tanium and CrowdStrike running.
-Tanium is only collecting CPU/memory usage stats and isn't monitoring any processes or files.
-CrowdStrike has application path's exceptions in place.

When we look at what is consuming the memory, we can see that MySQL is consuming much more memory than we would expect.

Mysql logs:-
2023-06-13T09:16:15.361318Z 0 [Warning] [MY-012152] [InnoDB] Open files 306 exceeds the limit 300
2023-06-13T09:16:15.361851Z 0 [Warning] [MY-012152] [InnoDB] Open files 306 exceeds the limit 300
2023-06-14T08:07:54.003721Z 0 [Warning] [MY-012152] [InnoDB] Open files 306 exceeds the limit 300
2023-06-14T11:17:10.650397Z 477011 [ERROR] [MY-010934] [Server] Out of memory (Needed 1048616 bytes)
2023-06-14T11:17:11.004275Z 0 [ERROR] [MY-010934] [Server] Out of memory (Needed 1048615 bytes)
11:17:11 UTC - mysqld got exception 0xc0000005 ;
Most likely, you have hit a bug, but this error can also be caused by malfunctioning hardware.
Thread pointer: 0x2b1d0e64d40
Attempting backtrace. You can use the following information to find out
where mysqld died. If you see no messages after this, something went
terribly wrong...
2023-06-14T11:17:12.521550Z 0 [ERROR] [MY-010934] [Server] Out of memory (Needed 1048615 bytes)
2023-06-14T11:17:12.839860Z 477013 [ERROR] [MY-010934] [Server] Out of memory (Needed 1048616 bytes)
2023-06-14T11:17:12.973398Z 0 [ERROR] [MY-010934] [Server] Out of memory (Needed 1048615 bytes)
2023-06-14T11:17:13.088207Z 477014 [ERROR] [MY-010934] [Server] Out of memory (Needed 1048616 bytes)

Want some assistance to troubleshoot the issue.

How to repeat:
Not Reproducable
[5 Dec 2023 10:38] MySQL Verification Team
Hi Mr. Singh,

Thank you for your bug report.

However, let us inform you that this is a forum for the reports with fully repeatable test cases and you have not provided one.

We can only provide you with some general advice. Look at the configuration of MySQL that you have set. You could have set some buffers too high ...... 

Especially look at the number of concurrent connections that are running when MySQL cannot allocate memory. Then carefully analyse settings that allocate memory on the connection level. For example, if you run queries that require temporary tables and sorting, then if both are set, for example at 64 Mb and you have 1.000 such connections, then you will have a need for 128 Gb of RAM.

This is not a forum for the free support, so we can not help you with your problem.

Also, for your information, this is not a bug. That is something that happens to many misconfigured MySQL installations.

Can't repeat.