[MDEV-17146] Memory leak on multiple reuse of prepared statement Created: 2018-09-06 Updated: 2018-11-01 Resolved: 2018-11-01 |
|
| Status: | Closed |
| Project: | MariaDB Server |
| Component/s: | Prepared Statements |
| Affects Version/s: | 10.1.26 |
| Fix Version/s: | N/A |
| Type: | Bug | Priority: | Major |
| Reporter: | Mariusz Gronczewski | Assignee: | Unassigned |
| Resolution: | Incomplete | Votes: | 0 |
| Labels: | need_feedback | ||
| Environment: |
Debian stable, package 10.1.26-0+deb9 |
||
| Attachments: |
|
| Description |
|
See attached screenshot for memory stats. MariaDB is biggest running process in system and it has only ~100MB database (it is slave) We've upgraded version of mysql that runs our PowerDNS instances (and PowerDNS version itself) and noticed they started leaking memory. After closer inspection via wireshark I've noticed PowerDNS just makes one prepared statement then constantly executes and resets it, which leads me to believe there is a leak somewhere. After restarting PowerDNS (which ends the connection to MariaDB), memory is freed. The prepared statement is made to a view if that has any significance |
| Comments |
| Comment by Alice Sherepa [ 2018-09-10 ] | |||||||||||||||||||||||||||
|
xani, could you please provide the test case to demonstrate the problem and your configuration of the server. | |||||||||||||||||||||||||||
| Comment by Mariusz Gronczewski [ 2018-09-10 ] | |||||||||||||||||||||||||||
|
There lies the problem, I have been trying to come up with test case but the code that causes it is in C++ ( https://github.com/PowerDNS/pdns/blob/master/modules/gmysqlbackend/smysql.cc ) and I haven't been able to reproduce same results with tools I normally use (I don't know C++, only Perl and Go). From what I can see in wireshark, PDNS does prepare then (request execute-> response It also does NOT happen when querying records table directly, only when querying a view records_public or records_private schema.sql
| |||||||||||||||||||||||||||
| Comment by Elena Stepanova [ 2018-10-04 ] | |||||||||||||||||||||||||||
|
The code doesn't specify what is actually being run. We still need a working example which would demonstrate the memory leak on the server side. |