Bug #55142 mysql proxy memory leak when frequently connect / disconnect
Submitted: 9 Jul 2010 23:34 Modified: 15 Jan 2015 23:57
Reporter: Kevin Zhou Email Updates:
Status: No Feedback Impact on me:
Category:MySQL Proxy: Core Severity:S2 (Serious)
Version:0.7.2 and 0.8 OS:Linux (Ubuntu 9.10)
Assigned to: Jan Kneschke CPU Architecture:Any

[9 Jul 2010 23:34] Kevin Zhou
Hi guys, 

We are using mysql proxy for a pretty busy database for more than one year. It works well, except there are some obviously memory leak, the process starts small (<50MB) and climbs gradually over the course of days to be over 1GB in size. So we have to restart mysql proxy every 10 days. 

We have done extensively testing in our dev environment and even we run a mysql proxy without any customized lua script and keep querying with SHOW TABLES only and disconnect, the memory usage still continues going up. 

We have run valgrind for it, and it does suggest a memory leak. 

How to repeat:
- write a simple test script which just connect, issue a simple query (show tables), disconnect, sleep a while and then continue do the same thing again. 
- restart mysql proxy
- run 40 instances of the simple test script. 
- keep monitoring the memory usage of the mysql proxy
[9 Jul 2010 23:38] Kevin Zhou
valgrind output in xml

Attachment: valgrind.xml (text/xml), 203.87 KiB.

[12 Jul 2010 20:34] Sveta Smirnova
Thank you for the report.

Which options do you use when start MySQL Proxy?
[12 Jul 2010 20:35] Sveta Smirnova
See also bug #54975
[12 Jul 2010 20:59] Kevin Zhou
Hi Sveta,

Thank you for quick response, 

I am using following lines the start mysql proxy (i tested with both with/without lua script). 

== without lua script ==
mysql-proxy --proxy-backend-addresses= --proxy-address=

== with lua script ==
mysql-proxy --proxy-backend-addresses= --proxy-lua-script=/data/mysql-proxy/partition/main.lua --proxy-address=
[5 May 2012 15:37] Ross Carver
I also am experiencing this. We are not using any special lua scripts and memory increases in version 0.8.1. Please let me know if there is an updated to this bug.
[15 Dec 2014 23:57] Sveta Smirnova
Thank you for the feedback.

Please try with current version 0.8.5 and inform us if bug still exists: I could not repeat it after 4 hours run.
[16 Jan 2015 1:00] Bugs System
No feedback was provided for this bug for over a month, so it is
being suspended automatically. If you are able to provide the
information that was originally requested, please do so and change
the status of the bug back to "Open".