[MXS-3068] memory leak Created: 2020-07-06 Updated: 2021-05-02 Resolved: 2021-04-08 |
|
| Status: | Closed |
| Project: | MariaDB MaxScale |
| Component/s: | N/A |
| Affects Version/s: | 2.3.20, 2.4.13 |
| Fix Version/s: | N/A |
| Type: | Bug | Priority: | Major |
| Reporter: | Massimo | Assignee: | markus makela |
| Resolution: | Cannot Reproduce | Votes: | 0 |
| Labels: | None | ||
| Environment: |
Centos 7.6.181 |
||
| Attachments: |
|
||||||||
| Issue Links: |
|
||||||||
| Sprint: | MXS-SPRINT-111, MXS-SPRINT-112, MXS-SPRINT-113, MXS-SPRINT-114, MXS-SPRINT-115, MXS-SPRINT-116, MXS-SPRINT-117, MXS-SPRINT-118, MXS-SPRINT-120, MXS-SPRINT-121, MXS-SPRINT-122, MXS-SPRINT-123 | ||||||||
| Description |
|
we are facing memory leak by maxscale here is the conf:
and:
and
and
and
|
| Comments |
| Comment by markus makela [ 2020-10-16 ] | |||||||||||||
|
Persistent connections have been ruled out as a cause. | |||||||||||||
| Comment by markus makela [ 2020-10-16 ] | |||||||||||||
|
Possibly caused by | |||||||||||||
| Comment by markus makela [ 2020-10-16 ] | |||||||||||||
|
Unlikely to be caused by | |||||||||||||
| Comment by markus makela [ 2020-10-16 ] | |||||||||||||
|
There appears to be a leak in 2.3.20 that is very similar to
| |||||||||||||
| Comment by markus makela [ 2020-10-16 ] | |||||||||||||
|
Backporting the fix to | |||||||||||||
| Comment by markus makela [ 2020-10-16 ] | |||||||||||||
|
johan.wikman can you analyze why the following memory leak occurs in 2.3 but doesn't in 2.4?
| |||||||||||||
| Comment by Johan Wikman [ 2020-10-19 ] | |||||||||||||
|
markus makela There is a bug in sqlite as it may leak memory if it fails to parse a statement. If sqlite is used as a database that is not a problem, because, for obvious reasons, you will not use such statements. However, it may be a problem in MaxScale since if the statement is legal MariaDB SQL it obviously may be used over and over again, each time potentially causing a leak in sqlite if the statement cannot be fully parsed by the sqlite parser. The default sqlite does not recognize DIV , but / must be used. As
uses DIV it means that sqlite was not able to fully parse it, which in this case then apparently caused a leak. The fix of | |||||||||||||
| Comment by Johan Wikman [ 2020-10-19 ] | |||||||||||||
|
This may also be an indication that some sqlite lemon destructor still is missing, although | |||||||||||||
| Comment by markus makela [ 2020-10-20 ] | |||||||||||||
|
Assigning this for you johan.wikman since it looks like it's SQLite related. | |||||||||||||
| Comment by markus makela [ 2020-12-28 ] | |||||||||||||
|
With a new configuration that doesn't use persistent connections and a correctly configured max_sescmd_history, the memory leak does not appear to happen as fast as before. It might even be that it'll eventually flatten out as the query classifier cache is populated. | |||||||||||||
| Comment by Johan Wikman [ 2021-02-16 ] | |||||||||||||
|
massimo.disaro Could you find out whether they are using window functions that use PRECEDING or FOLLOWING? |