Bug #96612 MySQL 5.7.26 does not release memory after executing a query
Submitted: 22 Aug 2019 8:12 Modified: 22 Aug 2019 12:55
Reporter: Marco Giulioli Email Updates:
Status: Not a Bug Impact on me:
None 
Category:MySQL Server Severity:S3 (Non-critical)
Version:5.7.26 OS:Windows (Windows Server 2016 Datacenter)
Assigned to: CPU Architecture:Any

[22 Aug 2019 8:12] Marco Giulioli
Description:
We use AppDynamics Controller, which relies on MySQL 5.7.26.
When we execute queries, the memory utilization by the mysqld process continually increases.
Mysql is not releasing memory on system when executing the same query multiple times and and it just keeps on increasing as the system is used until the OS fails due to lack of memory. 
At the moment our workaround is to restart the DB immediately after backups so releasing the memory, but this can't be the solution.
We met the same problem also when we were using the v5.5.59 version of mysql.
At the moment we use the v5.7.26 because it is the version which is bundled in the last installation package released by AppDynamics.

How to repeat:
1. Check memory utilized by mysqld process using top or system monitor.
2. Execute some queries every day, for multiple times. Check that the query completes successfully
3. At the end of the execution of the query, every day, check the memory utilized and you see that it continually increases
[22 Aug 2019 12:55] MySQL Verification Team
Hi Signor Giulloli,

Thank you for your bug report.

Unfortunately, what you report is not a bug. We check each release thoroughly for the memory leaks by several professional tools. What you see is expected behaviour. MySQL is not allocating all memory at once, but will use memory up to the limits set by our configuration variables.

Hence, check all your global and local buffer settings. They might not be necessary set by you, but by that application that you use.