OceanBase Database allows you to set its maximum memory in two methods:
Determine the maximum memory that can be allocated to OceanBase Database based on the percentage of memory that it can occupy, which is specified by the
memory_limit_percentageparameter.Directly set the maximum memory that can be allocated to OceanBase Database by specifying the
memory_limitparameter. Whenmemory_limitis set to 0, the value of memory_limit_percentage prevails. Otherwise, the absolute value is used.
The following table gives two configuration examples illustrating 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 for OceanBase Database |
|---|---|---|---|
| Example 1 | 80 | 0 | 80 GB |
| Example 2 | 80 | 90 GB | 90 GB |
In example 1, memory_limit is set to 0. Therefore, the value memory_limit_percentage prevails, and the maximum memory for OceanBase Database is 100 GB × 80% = 80 GB.
In example 2, memory_limit is set to 90 GB. Therefore, memory_limit determines the maximum memory for OceanBase Database, which is 90 GB. Notice
Mainstream OceanBase Database servers are usually configured with a 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 OceanBase Database.