[MDEV-21348] Memory leak in Storage-Engine Independent Column Compression Created: 2019-12-18 Updated: 2020-04-01 Resolved: 2020-04-01 |
|
| Status: | Closed |
| Project: | MariaDB Server |
| Component/s: | Data types |
| Affects Version/s: | 10.4.8, 10.4.11, 10.5.0 |
| Fix Version/s: | 10.3.23, 10.4.13, 10.5.3 |
| Type: | Bug | Priority: | Major |
| Reporter: | Martijn | Assignee: | Sergey Vojtovich |
| Resolution: | Fixed | Votes: | 0 |
| Labels: | Memory_leak | ||
| Environment: |
Linux |
||
| Description |
|
The Storage-Engine Independent Column Compression ( https://github.com/MariaDB/server/blob/10.5/sql/field_comp.cc#L70-L72 According to the zlib manual deflate() can also return other values:
This for instance happens when the data is already (externally) compressed and deflate() needs more space than the original data. There is no use in enlarging the output buffer and calling deflate() again, but memory still needs to be freed by calling deflateEnd(). When running the following query on an existing table with ~100.000 records MariaDB quickly uses up several gigabytes of memory (without returning it): Tried on MariaDB 10.4.8, 10.4.11 and 10.5 |