- This refers to the maximum amount of memory that can be used as a memory tablespace (memory table or memory data) stored in physical memory.
- Constraints on the total usage of all memory tablespaces combined.
- This is not the maximum size that each of the memory tablespaces can use.
- The size of the index created on the memory table is not included.
- It also includes historical data that occurs when performing change transactions.
When a change transaction is performed, the past data is retained until the transaction is terminated (MVCC technique). In the case of a memory table, a replica of the record is created in the memory table.
- If the maximum value is not specified when creating a memory tablespace, it is automatically expanded by the value set for MEM_MAX_DB_SIZE.
- It is recommended to set it to about 60~70% of the physical memory.
- In addition to the memory data, must consider the size of the record replicas that will be created by the MVCC technique when performing a change transaction.
For example, if a change transaction occurs in a 1G memory table, the size of the table may be 2G when the transaction is completed.
- Since memory is a shared resource that should be used by the OS and other processes as well as the Altibase server process, it should be set lesser than the physical memory.
- Although it is possible to set MEM_MAX_DB_SIZE larger than the physical memory, if the memory is used beyond the physical memory, swap in/out may occur, resulting in performance degradation and various problems in the system.
How to Change
When to set it larger than the current value
This section describes the parts to be considered when setting MEM_MAX_DB_SIZE larger than the current value.
Memory tablespaces store two sets of 'memory checkpoint image files on disk for backup purposes. So it requires twice as much disk space as the memory data usage.
If MEM_MAX_DB_SIZE is set large, disk usage will also increase, so make sure to free up disk space before changing MEM_MAX_DB_SIZE.
Ex) If MEM_MAX_DB_SIZE is 60G, 120G of disk space is required.
User environment setting (Linux/Unix)
The user should run ulimit -a to make sure that the settings below are set to the maximum values allowed by the OS.
max memory size
Kernel parameters (AIX, HP-UX)
For AIX, check if data, rss, fsize, etc. are set to -1 in the /etc/security/limits file.
For HP, check that the maxdsiz_64bit value is set large enough via kctune.
Linux and SunOS are not applicable.
When to set it less than the current value
This section describes the parts to be considered when setting MEM_MAX_DB_SIZE less than the current value.
- MEM_MAX_DB_SIZE cannot be set less unconditionally.
- Check the increased 'Checkpoint Image File' size and set it larger than that.
Its size can be checked with the statement below.
If TOTAL is less than MAX, set MEM_MAX_DB_SIZE to be larger than TOTAL and smaller than the existing value.
TOTAL(M) means the total page size allocated to the memory tablespace.
This value also includes free pages in the memory tablespace.
Free pages may not be loaded into physical memory. So this value cannot be viewed as the physical memory usage of the memory tablespace.
This value also refers to the size of the checkpoint image file.
TOTAL does not decrease except in the case of DROP TABESPACE. Restarting the Altibase server does not decrease the value.
How to change
1. Stop the Altibase Server
2. Change the altibase.properties file
Save after changing MEM_MAX_DB_SIZE in the Altibase server properties file ($ALTIBASE_HOME/conf/altibase.properties).
3. Start the Altibase Server
Check the setting value
The setting value can be checked in two methods as below.