[MDEV-29431] SQL interface and Storage Engine interface for reclaiming memory Created: 2022-09-01 Updated: 2022-09-06 |
|
| Status: | Open |
| Project: | MariaDB Server |
| Component/s: | Server |
| Fix Version/s: | None |
| Type: | Task | Priority: | Minor |
| Reporter: | Daniel Black | Assignee: | Unassigned |
| Resolution: | Unresolved | Votes: | 0 |
| Labels: | None | ||
| Issue Links: |
|
||||||||||||
| Description |
|
In The purpose of releasing memory is to be co-operative in cloud environments, shared hosting and other memory constrained areas. Activities like VM migration could also pre-trigger this SQL interface to avoid saving/migrating/restoring/tracking memory that isn't used. In the automated ( As each storage engine (and non-storage like thread pool) can cache/uncache in various ways, perhaps a storage engine optional handler function call can make available such mechanism. On the SQL interface rather than a system variable, suggest FLUSH [FULL] UNUSED MEMORY could trigger the handler interfaces in the same way that the automated mechanism ( What a basic vs full flush will largely depend on storage engine. To aid the differentiation inspired by marko maybe a global variable of recently_cached=600 as the number of seconds to consider recent. A "basic" flush will purge unused caches over this time and "full" can venture significantly less than this user controlled threshold to a minium defined by the storage engine. |