At a glance
Memory Usage % is the share of the instance’s available RAM that the MariaDB server process and its caches are currently holding, expressed as a percentage of the host (or container) memory limit. For a DBA this is the single number that tells you how much headroom is left before the kernel out-of-memory (OOM) killer starts terminating the mariadbd process. The InnoDB buffer pool, the per-connection buffers, and the various session caches all draw from the same pool; once the working set plus connection overhead crosses the physical limit, the database either swaps (slow) or is killed (an outage). This card watches the live figure so you see pressure building before the OOM event, not after.
Calculation
The card expresses used memory as a percentage of the instance limit:- Global, allocated once at startup: the InnoDB buffer pool (
innodb_buffer_pool_size), the key buffer, the query cache (deprecated and off by default in modern MariaDB), andperformance_schemaoverhead. - Per-connection, allocated on demand:
sort_buffer_size,join_buffer_size,read_buffer_size,tmp_table_size, andmax_heap_table_size. These multiply by the number of active connections, which is why a connection spike can drive memory up even when the buffer pool is fixed.
RT window so a brief in-memory sort does not register as a sustained problem; the > 85% alert only fires when the elevated reading persists across consecutive samples.
Worked example
A platform team runs a MariaDB 10.11 primary on a 32 GB instance backing an ecommerce catalogue and order store. The buffer pool is set to 20 GB. Snapshot taken on 14 Apr 26 at 20:05 BST, during an evening promotion.
The card reads 86% and the alert trips at 20:05. The DBA reads three things at a glance:
- The buffer pool is not the problem; the connections are. The fixed global pool is 20 GB, comfortably below the limit. The 5.4 GB of per-connection buffers is what pushed the total over 85%, driven by 420 connections during the promotion and a handful running unindexed sorts.
- There is roughly 4.5 GB of headroom left. At the current per-connection rate that is around 350 more connections before the limit. If Connection Pool Saturation % is also climbing, the two cards together predict an OOM within the promotion window.
- The cheapest immediate lever is the application connection pool, not the server. Lowering the app-side max pool or capping
max_connectionsreduces the per-connection multiplier instantly. Resizing the buffer pool requires a restart and would not help here.
Sibling cards
Reconciling against the source
Where to look in MariaDB’s own tooling:On a managed service, compare against the provider’s instance memory metric: the freeable-memory and memory-utilisation graphs on the managed-database console. Those read the same RSS-against-limit ratio this card uses. Why our number may legitimately differ from MariaDB’s own view:SHOW GLOBAL STATUS LIKE 'Memory_used'for the server’s own accounting of bytes allocated (available when memory instrumentation is on).SELECT * FROM performance_schema.memory_summary_global_by_event_name ORDER BY CURRENT_NUMBER_OF_BYTES_USED DESCto break memory down by allocator, which separates the buffer pool from per-connection buffers.SHOW ENGINE INNODB STATUS\Gunder the BUFFER POOL AND MEMORY section for the InnoDB-specific allocation. OS-levelfree -m,ps -o rss -p $(pidof mariadbd), or the cgroupmemory.currentfor the resident figure the OOM killer actually sees.
Known limitations / FAQs
My buffer pool is only 60% of RAM but the card reads 88%. How? The buffer pool is the floor, not the ceiling. Per-connection buffers (sort_buffer_size, join_buffer_size, tmp_table_size) are allocated on top of the global pool, once per connection that needs them. A few hundred connections each running a large sort can add several gigabytes. Check Connections In Use and the per-connection buffer settings before assuming the buffer pool is at fault.
Should I just add more RAM when this alert fires?
Sometimes, but only after ruling out the cheaper fixes. If the pressure comes from per-connection buffers, lowering the application pool size or capping max_connections helps immediately and for free. If the pressure comes from a buffer pool that is genuinely too small for a growing working set (confirmed by a falling Buffer Pool Hit Rate %), then more RAM is the right answer.
Why is the threshold 85% and not 95%?
Because the OOM killer does not wait politely at 100%. Linux can begin reclaiming and, under memory pressure, kill processes well before the counter reads full, especially inside a cgroup. 85% gives a DBA time to react (cap connections, kill a runaway sort, schedule a resize) before swap thrashing or an OOM kill takes the instance down.
Does this include the OS page cache?
No. The card measures the mariadbd process resident memory against the limit. The OS page cache is reclaimable and lives outside the process, so it is excluded. Some managed-service “memory utilisation” graphs include page cache, which is why their figure can read higher than this card.
My instance swaps but the card never crosses 85%. Why?
Aggressive swappiness or a low cgroup limit can push the instance into swap before RSS reads 85% of the host total, particularly on hosts shared with other tenants. Lower vm.swappiness for database hosts and confirm the card is dividing by the container limit, not the host total. Pair with Query Latency p95 (ms): swap shows up as a latency cliff long before it shows as full memory.
Does a Galera cluster change how I read this card?
Yes, watch every node. Galera replicates writes synchronously, so a node under memory pressure can throttle the whole cluster via flow control. A single node at 90% memory while the others sit at 60% is the node that will pause the cluster first. Pair with Galera Flow Control Paused %.
Can a connection leak cause this?
Yes. Idle connections that the application never closes still hold their session buffers. If memory climbs while Queries per Second (live) stays flat or low, suspect a leak: connections accumulating without doing work. Check SHOW PROCESSLIST for a growing count of Sleep connections and fix the application pool’s idle timeout.