# Change Memory Limits

> **📝 Note**: If you increase the amount of memory available to SingleStore, you must also ensure that your license covers the new amount  Refer to [Determining capacity and usage for your license](https://docs.singlestore.com/db/v9.0/user-and-cluster-administration/maintain-your-cluster/setting-or-replacing-a-license/determining-capacity-and-usage-for-your-license.md) for more information.

## Overview

The [maximum\_table\_memory](https://docs.singlestore.com/db/v9.0/user-and-cluster-administration/maintain-your-cluster/managing-memory/maximum-table-memory.md) and [maximum\_memory](https://docs.singlestore.com/db/v9.0/user-and-cluster-administration/maintain-your-cluster/managing-memory/maximum-memory.md) engine variable values are based on a host's memory capacity at the time SingleStore is deployed. These values can be updated via SQL, Toolbox, or defined in the `memsql.cnf` file of each node. Note that these engine variables have no impact on licensing.

If Toolbox is used to [optimize for NUMA](https://docs.singlestore.com/db/v9.0/reference/singlestore-tools-reference/sdb-admin-commands/optimize.md), then these values are not automatically updated when a host's memory capacity changes. Toolbox sets a value of `maximum_memory` in the `memsql.cnf` file and, if memory is later added to the host, the `memsqld` process will not pick it up. Refer to [Configuring SingleStore for NUMA](https://docs.singlestore.com/db/v9.0/reference/configuration-reference/cluster-configuration/configuring-singlestore-for-numa.md) for more information.

If Toolbox is not used to optimize for NUMA, the database engine sets the value of `maximum_memory`, which is based on the amount of memory at the time the `memsqld` process is started. If memory is later added to the host, the `memsqld` process will pick it up when it's restarted.

In some cases, you may wish to change the memory limit for each node after deploying SingleStore. If you opt to do so, please note the following:

* Decrease the `maximum_table_memory` value before decreasing the `maximum_memory` value.

  If `maximum_memory` is set to a value below `maximum_table_memory`, the value of `maximum_table_memory` is automatically decreased as well, to the extent possible. If Alloc\_table\_memory  (viewable via `SHOW STATUS EXTENDED LIKE 'Alloc_table_memory';)` is sufficiently high, then `maximum_table_memory` *may* be set to an atypically higher value than 90% of `maximum_memory`, which is the default.
* When decreasing the `maximum_table_memory` value, ensure that the value of the `Alloc_table_memory`  summary variable does not exceed the new `maximum_table_memory` value. If attempted, an error will occur and the value will not be set.
* By default, `maximum_memory` is set to 90% of the physical memory on the host, or physical memory minus 10GB, whichever value is greater. SingleStore does not recommend exceeding either of these two limits when setting the `maximum_memory` value.
* When decreasing the `maximum_memory` value, ensure that the value of the `Total_server_memory` summary variable (also viewable via `SHOW STATUS EXTENDED LIKE 'Total_server_memory';`) does not exceed the new `maximum_memory` value. If attempted, an error will occur and the value will not be set.
* Do not set the `maximum_memory` value less than 1GB.
* When you change `maximum_memory` or `maximum_table_memory` with Toolbox, whether the running value changes immediately depends on how the change is applied:

  * `sdb-admin update-config --key ... --value ...` writes the value to the node's `memsql.cnf` file. The running value is applied the next time the node restarts.
  * `sdb-admin update-config --set-global --key ... --value ...` applies the value immediately to the running node.

  Do not rely on Toolbox to display a restart prompt to decide whether a restart is required. If you update only the node configuration, restart the affected node to apply the change.

SingleStore recommends that each leaf node is allocated an equal amount of CPU and RAM. Refer to [Calculating Memory Allocation per Host in a Cluster](https://docs.singlestore.com/db/v9.0/user-and-cluster-administration/high-availability-and-disaster-recovery/replicating-data-across-clusters/calculating-memory-allocation-per-host-in-a-cluster.md) for more information.

## Example

The following example illustrates how to update the values of the `maximum_table_memory` and `maximum_memory` variables after adding memory to an 8 GB (8192 MB) virtual machine, or “host,” with an instance of SingleStore non-Docker [cluster-in-a-box,](https://docs.singlestore.com/db/v9.0/deploy/linux.md) which consists of one Master Aggregator node and one leaf node.

This example uses `sdb-admin update-config` without `--set-global`, which updates node configuration. Restart the affected nodes after the configuration changes to apply the new values.

To apply the change immediately, use `SET GLOBAL` or `sdb-admin update-config --set-global`. These commands update the running value without requiring a node restart.

1. Use the following command to obtain the node IDs from the `MEMSQL_ID` column.
   ```shell
   sdb-admin list-nodes
   ```

2. You can view the current `maximum_table_memory` and `maximum_memory` values of each node by running the following Toolbox commands.

   **Master Aggregator**
   ```shell
   sdb-admin describe-node --property Variables.maximum_table_memory --memsql-id <Master_Aggregator_MEMSQL_ID>

   ```
   ```output

   6014
   ```
   ```shell
   sdb-admin describe-node --property Variables.maximum_memory --memsql-id <Master_Aggregator_MEMSQL_ID>

   ```
   ```output

   7038
   ```
   **Leaf Node**
   ```shell
   sdb-admin describe-node --property Variables.maximum_table_memory --memsql-id <leaf_node_MEMSQL_ID>

   ```
   ```output

   6014
   ```
   ```shell
   sdb-admin describe-node --property Variables.maximum_memory --memsql-id <leaf_node_MEMSQL_ID>

   ```
   ```output

   7038
   ```

3. If you later add an additional 2 GB (2048 MB) of RAM to this host, run the following command to update the memory limits and optimize other related settings.
   ```shell
   sdb-admin optimize
   ```
   This command can reset `maximum_memory` based on the host's memory-related configuration, but it does not update `maximum_table_memory`. If you want to change `maximum_table_memory`, set this variable explicitly. Do not assume that both memory settings have been updated after running `sdb-admin optimize`. Instead, verify both values explicitly.

   **Master Aggregator**
   ```shell
   sdb-admin describe-node --property Variables.maximum_table_memory --memsql-id <Master_Aggregator_MEMSQL_ID>

   ```
   ```output

   7829
   ```
   ```shell
   sdb-admin describe-node --property Variables.maximum_memory --memsql-id <Master_Aggregator_MEMSQL_ID>

   ```
   ```output

   8853
   ```
   **Leaf Node**
   ```shell
   sdb-admin describe-node --property Variables.maximum_table_memory --memsql-id <leaf_node_MEMSQL_ID>

   ```
   ```output

   7829
   ```
   ```shell
   sdb-admin describe-node --property Variables.maximum_memory --memsql-id <leaf_node_MEMSQL_ID>

   ```
   ```output

   8853
   ```

4. After `sdb-admin optimize`, the memory limits may be higher than the original values. In this example, `maximum_table_memory` is 7829 MB and `maximum_memory` is 8853 MB. To pin the Master Aggregator and leaf node's `maximum_memory` at 8 GB (8192 MB), set the corresponding engine variables to the lower target values. This configuration allows other applications to use the remaining host memory.

   1. First, set `maximum_table_memory` to 7209 MB, decreasing it from the 7829 MB value updated by `sdb-admin optimize`:

      **Master Aggregator**
      ```shell
      sdb-admin update-config --key maximum_table_memory --value 7209 --memsql-id <Master_Aggregator_MEMSQL_ID>
      ```
      **Leaf Node**
      ```shell
      sdb-admin update-config --key maximum_table_memory --value 7209 --memsql-id <leaf_node_MEMSQL_ID>
      ```

   2. Next, set `maximum_memory` to 8192 MB, decreasing it from the 8853 MB value updated by `sdb-admin optimize`:

      **Master Aggregator**
      ```shell
      sdb-admin update-config --key maximum_memory --value 8192 --memsql-id <Master_Aggregator_MEMSQL_ID>
      ```
      **Leaf Node**
      ```shell
      sdb-admin update-config --key maximum_memory --value 8192 --memsql-id <leaf_node_MEMSQL_ID>
      ```

5. Restart the cluster.
   ```shell
   sdb-admin restart-node --all
   ```

## View Variable Values

You can confirm that the nodes reflect these new values via a variety of methods.

## Query the Information Schema

```sql
USE information_schema
SELECT * FROM mv_nodes;

```

```output

+----+-----------+------+------+---------------+---------------------+
| ID | IP_ADDR   | PORT | TYPE | MAX_MEMORY_MB | MAX_TABLE_MEMORY_MB |
+----+-----------+------+------+---------------+---------------------+
|  2 | 127.0.0.1 | 3307 | LEAF |          8192 |                7209 |
|  1 | 127.0.0.1 | 3306 | MA   |          8192 |                7209 |
+----+-----------+------+------+---------------+---------------------+
```

**Note**: Columns have been removed to highlight the max\_memory\_mb and the max\_table\_memory\_mb columns.

## Query the Variables

```sql
SELECT @@global.maximum_table_memory;

```

```output

+-------------------------------+
| @@global.maximum_table_memory |
+-------------------------------+
|                          7209 |
+-------------------------------+
```

```sql
SELECT @@global.maximum_memory;

```

```output

+-------------------------+
| @@global.maximum_memory |
+-------------------------+
|                    8192 |
+-------------------------+
```

## Use Toolbox

**Master Aggregator**

```shell
sdb-admin describe-node --property Variables.maximum_table_memory --memsql-id <Master_Aggregator_MEMSQL_ID>

```

```output

7209
```

```shell
sdb-admin describe-node --property Variables.maximum_memory --memsql-id <Master_Aggregator_MEMSQL_ID>

```

```output

8192
```

**Leaf Node**

```shell
sdb-admin describe-node --property Variables.maximum_table_memory --memsql-id <leaf_node_MEMSQL_ID>

```

```output

7209
```

```shell
sdb-admin describe-node --property Variables.maximum_memory --memsql-id <leaf_node_MEMSQL_ID>

```

```output

8192
```

## View the memsql.cnf File

> **📝 Note**: Node configuration folders typically reside in `/var/lib/memsql/`.As the node subfolder names are GUIDs, you can determine which subfolder corresponds to which node by viewing the port number in the `memsql`.cnf file of each subfolder.Refer [memsql.cnf](https://docs.singlestore.com/db/v9.0/reference/configuration-reference/engine-variables/memsql-cnf.md) for more information.

**Master Aggregator**

```shell
cat /var/lib/memsql/<Master_Aggregator_MEMSQL_ID>/memsql.cnf | grep maximum_table_memory

```

```output

maximum_table_memory = 7209
```

```shell
cat /var/lib/memsql/<Master_Aggregator_MEMSQL_ID>/memsql.cnf | grep maximum_memory

```

```output

maximum_memory = 8192
```

**Leaf Node**

```shell
cat /var/lib/memsql/<leaf_node_MEMSQL_ID>/memsql.cnf | grep maximum_table_memory

```

```output

maximum_table_memory = 7209
```

```shell
cat /var/lib/memsql/<leaf_node_MEMSQL_ID>/memsql.cnf | grep maximum_memory

```

```output

maximum_memory = 8192
```

## Related Resources

* Deploy the [SingleStore Dev Image](https://docs.singlestore.com/db/v9.0/deploy/singlestore-dev-image.md) for testing and development
* Learn more about the [memsql.cnf](https://docs.singlestore.com/db/v9.0/reference/configuration-reference/engine-variables/memsql-cnf.md) file and related [configuration files](https://docs.singlestore.com/db/v9.0/reference/configuration-reference/cluster-config-files.md)
* [Calculating Memory Allocation per Host in a Cluster](https://docs.singlestore.com/db/v9.0/user-and-cluster-administration/high-availability-and-disaster-recovery/replicating-data-across-clusters/calculating-memory-allocation-per-host-in-a-cluster.md)
* [Determining capacity and usage for your license](https://docs.singlestore.com/db/v9.0/user-and-cluster-administration/maintain-your-cluster/setting-or-replacing-a-license/determining-capacity-and-usage-for-your-license.md)
* Learn more about updating the `maximum_table_memory` variable to address the [“Maximum Table Memory” error](https://docs.singlestore.com/db/v9.0/user-and-cluster-administration/maintain-your-cluster/managing-memory/addressing-the-maximum-table-memory-error.md)

***

Modified at: September 30, 2026

Source: [/db/v9.0/user-and-cluster-administration/maintain-your-cluster/managing-memory/change-memory-limits/](https://docs.singlestore.com/db/v9.0/user-and-cluster-administration/maintain-your-cluster/managing-memory/change-memory-limits/)

(An index of the documentation is available at /llms.txt)
