This topic describes how to set the maximum memory for an OceanBase database and provides configuration examples.
Parameters used to set the maximum memory for an OceanBase database
OceanBase Database provides the following parameters for you to set the maximum memory for an OceanBase database:
memory_limit_percentage: specifies the percentage of maximum server memory that can be occupied by an OceanBase database.memory_limit: specifies the maximum memory for an OceanBase database. Ifmemory_limitis set to0M, the value ofmemory_limit_percentageprevails. Ifmemory_limitis set to another value, the specified absolute value is used.
Examples
The following examples illustrate how the values of the memory_limit_percentage and memory_limit parameters affect the actual maximum memory available to OceanBase Database, with the total server memory being 100 GB.
| Example | memory_limit_percentage | memory_limit | Maximum memory of an OceanBase database |
|---|---|---|---|
| Example 1 | 80 | 0M | 80 GB |
| Example 2 | 80 | 90 GB | 90 GB |
In Example 1,
memory_limitis set to0M. Therefore, thememory_limit_percentageparameter determines the maximum memory of the OceanBase database, which is 100 GB × 80% = 80 GB.In Example 2,
memory_limitis set to 90 GB. Therefore, thememory_limitparameter determines the maximum memory of the OceanBase database, which is 90 GB.Notice
Mainstream OceanBase Database servers are usually configured with 384 GB or 512 GB memory. We recommend that you allocate 80% of the 384 GB server memory or 90% of the 512 GB server memory to an OceanBase database.