Identifying and Reducing Memory Usage
On this page
SingleStore maintains a detailed account of memory usage.
An example of a typical question about memory usage is, "I only have 10GB of tables but I'm using 67GB of RAM? What is that additional memory being used for?"
You can run the command SHOW STATUS EXTENDED on an individual SingleStore instance to view a detailed break down of memory usage.
SHOW STATUS EXTENDED
The SHOW STATUS EXTENDED command displays a list of engine variable values as described in the following sections.
Summary variables
The following summary variables describe overall memory usage.
Total_ server_ memory
Total_ tracks the server’s overall memory use.maximum_.Total_ reaches maximum_, memory allocations start failing.1712 - "Not enough memory available to complete the current request.
In addition, the trace log shows the following: "Nonfatal buffer manager memory allocation failure.
Alloc_ table_ memory
Alloc_ tracks the memory stored inside of all rowstore tables (memory for rows, indexes, variable-length columns like VARCHAR or JSON that are stored off row).Alloc_ reaches maximum_, INSERT, UPDATE, and LOAD DATA operations against the tables receive the following error: 1720 - "Memory usage by SingleStore for tables (XXXXX MB) has reached the value of 'maximum_
Buffer_ manager_ memory
Buffer_ tracks memory that is allocated by the Buffer Manager for SingleStore’s built-in memory allocators.Buffer_ to be a large percentage of Total_.
Buffer_ manager_ cached_ memory
Buffer_ tracks cached memory blocks allocated by the Buffer Manager that are currently not in use, but still mapped.Buffer_ reflects the memory that may still be referenced until the check is complete.
While Total_ is at or below 90% of maximum_ or at least 10 GB of free memory remains, Buffer_ is capped at 25% of maximum_ on each node.maximum_.
When Total_ is above 90% of maximum_ and less than 10 GB of free memory remains, newly freed buffers are cached only until the cache size reaches approximately 1% of maximum_ (vs.
As cached memory stays mapped, Total_ includes Buffer_.DELETE, Alloc_ can fall while Total_ stays high because the freed memory blocks are still held as unrecycled or cached memory.
Refer to buffer_
Alloc_ query_ execution
Alloc_ tracks memory allocated by currently executing queries for sorts, hash tables, result tables, etc.
Alloc_ variable
Alloc_ tracks memory allocated for variable-length columns inside rowstore tables, or for other variable-length memory allocations inside query execution (i.
Alloc_ vector_ index
Alloc_ specifies the total size of vector indexes currently residing in memory.
Row store variables
Row store has a set of allocators it uses for various part of an index.
Alloc_ skiplist_ towers
Alloc_ tracks memory used by the towers for skiplist indexes.
Alloc_ table_ primary
Alloc_ tracks memory used for on-row data for rowstore tables.VARCHAR, VARBINARY, BLOB, TEXT, JSON, etc).Alloc_ that was previously discussed in this topic.
Alloc_ deleted_ version
Alloc_ tracks memory used to mark rows as deleted in rowstore tables.DELETE queries in SingleStore don’t free up memory when they commit.
Alloc_ hash_ buckets
Alloc_ tracks memory used for HASH index buckets (by default 4 million buckets per index, which would use 32 MB).
Other variables
A few variables describe memory used by components that are not directly related to running queries or storing data.
Alloc_ replication
Alloc_ tracks the amount of memory used during replication.
Malloc_ active_ memory
Malloc_ tracks memory allocated directly from the Linux OS and managed by the C runtime allocators (not SingleStore’s built-in memory allocators that use the Buffer Manager).
Alloc_ thread_ stacks
Alloc_ tracks memory used by thread stacks.thread_ session variable, but SingleStore does not recommend changing this value.idle_ variable).
In this section
Last modified: