[MXS-4009] Use actual size when calculating memory usage of query classifier cache Created: 2022-02-17 Updated: 2022-03-07 Resolved: 2022-03-07 |
|
| Status: | Closed |
| Project: | MariaDB MaxScale |
| Component/s: | QueryClassifier |
| Affects Version/s: | None |
| Fix Version/s: | 2.5.20, 6.2.3 |
| Type: | Task | Priority: | Major |
| Reporter: | Johan Wikman | Assignee: | Johan Wikman |
| Resolution: | Fixed | Votes: | 0 |
| Labels: | None | ||
| Issue Links: |
|
||||||||
| Description |
|
Currently the exact size of a cached entry is not used when limiting the amount of memory used by the query classifier cache. This may lead to the cache using more memory than what it is supposed to use. Further, when fields and functions are collected, separate strings are allocated for those. They should be stored as std::string_view:s pointing into the canonical statement. That would significantly reduce the amount of memory per query classifier cache entry. |