Bug #77616 | MySQL memory not release after connection closed | ||
---|---|---|---|
Submitted: | 3 Jul 2015 21:58 | Modified: | 9 May 2018 15:10 |
Reporter: | Liping Gao | Email Updates: | |
Status: | Not a Bug | Impact on me: | |
Category: | MySQL Server: Connection Handling | Severity: | S3 (Non-critical) |
Version: | 5.6.22, 5.6.23, 5.6.25 | OS: | Solaris (SunOS 5.11 11.2 sun4v sparc sun4v) |
Assigned to: | CPU Architecture: | Any | |
Tags: | memory leak, Memory not release |
[3 Jul 2015 21:58]
Liping Gao
[29 Sep 2016 14:40]
Suman Adhikari
What is the status of this?
[9 May 2018 15:10]
MySQL Verification Team
Hi, We have seen this behaviour thousands of times and we do know the exact cause of this behaviour. On all operating systems, malloc() library and / or brk() system call, does not release memory that is freed by some process. MySQL frees all memory allocated to any connection, which is done automatically. However, malloc libraries keep that chunk of memory attached to the process, but internally tagged as "unused". Internally means that this flag is seen only by malloc library. So, when next time process asks for memory allocation, malloc() library just gives it back (if possible) memory that is already attached to the process. That way, entire process is running faster, since many calls to the kernel are therewith saved. Some malloc libraries, like GNU or Solairs, do allow tuning of how malloc library works, but it only works up to certain degrees and for large allocations. You will get memory freed and very fast when total memory allocation runs up to the limits of RAM. In short, this has nothing to do with our software and is not a bug at all ......