15.6.2 Steps to take when a memory shortage occurs during execution of an SQL statement or command
This subsection explains the steps to take when either of the following messages is output during execution of an SQL statement or commands:
- Messages that are output
-
-
KFAA30930-E
-
KFAA40007-E
-
The steps depend on whether the adb_sys_memory_limit operand is specified in the server definition.
- Organization of this subsection
(1) When the adb_sys_memory_limit operand is specified in the server definition
The memory used by the HADB server is insufficient. Increase the value specified for the adb_sys_memory_limit operand in the server definition. Perform the following procedure.
Procedure:
-
Terminate the HADB server.
Terminate the HADB server by executing the adbstop command.
-
Change the server definition.
In the server definition, set the adb_sys_memory_limit operand to a value that is equal to or larger than the value determined from the following formula.
Formula (megabytes)
- Explanation of variables
-
get_size: Value of variable bb....bb in the KFAA30930-E or KFAA40007-E message (bytes)
-
Start the HADB server.
Execute the adbstart command to start the HADB server.
-
Re-execute the SQL statement or command.
- Note
-
For details about the adb_sys_memory_limit operand in the server definition, see the adb_sys_memory_limit operand in 7.2.2 Operands related to performance (set format).
(2) When the adb_sys_memory_limit operand is not specified in the server definition
Check the variable aa....aa in the KFAA30930-E or KFAA40007-E messages indicating the type of insufficient memory. The corrective action depends on the value of aa....aa.
(a) If the variable aa....aa is PROCESS
Process common memory is insufficient. Increase the value specified for the adb_sys_proc_area_max operand in the server definition. Perform the following procedure.
Procedure:
-
Estimate the maximum size of the memory used by the HADB server.
Execute the adbls -d mem command. In the output result, look for the value in the column MAX on the line whose THREAD-NO is 0.
For details about the adbls -d mem command, see adbls -d mem (display the memory usage status) in the manual HADB Command Reference.
-
Terminate the HADB server.
Terminate the HADB server by executing the adbstop command.
-
Change the server definition.
In the server definition, set the adb_sys_proc_area_max operand to a value that is equal to or larger than the value determined from the following formula.
Formula (megabytes)
- Explanation of variables
-
max_size: Value of MAX identified in step 1 (bytes)
get_size: Value of the variable bb....bb in the output message (bytes)
-
Start the HADB server.
Execute the adbstart command to start the HADB server.
-
Re-execute the SQL statement or command.
- Note
-
For details about the adb_sys_proc_area_max operand in the server definition, see the adb_sys_proc_area_max operand in 7.2.2 Operands related to performance (set format).
(b) If the variable aa....aa is THREAD
Real thread private memory is insufficient. Increase the value specified for the adb_sys_rthd_area_max operand in the server definition. Perform the following procedure.
Procedure:
-
Estimate the maximum size of the memory used by the HADB server.
Execute the adbls -d mem command. In the output result, look for the maximum value in the column MAX on all of the lines whose THREAD-NO is not 0.
For details about the adbls -d mem command, see adbls -d mem (display the memory usage status) in the manual HADB Command Reference.
-
Terminate the HADB server.
Terminate the HADB server by executing the adbstop command.
-
Change the server definition.
In the server definition, set the adb_sys_rthd_area_max operand to a value that is equal to or larger than the value determined from the following formula.
Formula (megabytes)
- Explanation of variables
-
max_size: Maximum value of MAX identified in step 1 (bytes)
get_size: Value of the variable bb....bb in the output message (bytes)
-
Start the HADB server.
Execute the adbstart command to start the HADB server.
-
Re-execute the SQL statement or command.
- Note
-
For details about the adb_sys_rthd_area_max operand in the server definition, see the adb_sys_rthd_area_max operand in 7.2.2 Operands related to performance (set format).
(c) If the variable aa....aa is HEAP
Heap memory is insufficient. Perform the following procedure.
Procedure:
-
Check whether there are any unneeded processes. If you find any unneeded processes, terminate or delete them.
-
If there is still not enough memory after performing step 1, take the following action.
-
Execute the adbstop command to terminate the HADB server.
-
Execute the adbstart command to start the HADB server.
-
-
If there is still not enough memory after performing step 2, take the following action.
-
Execute the adbstop command to terminate the HADB server.
-
Restart the OS.
-
Execute the adbstart command to start the HADB server.
If the problem occurred on a client, restart the client's OS.
-
-
If there is still not enough memory after performing step 3, take the following action.
-
Execute the adbstop command to terminate the HADB server.
-
Change the kernel parameter settings to increase the maximum size of memory that can be used by the process.
-
Restart the OS.
-
Execute the adbstart command to start the HADB server.
If the problem occurred on a client, change the kernel parameter settings on the client to increase the maximum size of memory that can be used by the process. Then, restart the client's OS.
-
-
Re-execute the SQL statement or command.
(d) If the variable aa....aa is SHARE
Shared memory is insufficient. Perform the following procedure.
Procedure:
-
Check whether there are any unneeded processes or shared memory. If you find any unneeded processes, terminate them. If you find any unneeded shared memory, delete it.
-
If there is still not enough shared memory after performing step 1, take the following action.
-
Execute the adbstop command to terminate the HADB server.
-
Execute the adbstart command to start the HADB server.
-
-
If there is still not enough shared memory after performing step 2, take the following action.
-
Execute the adbstop command to terminate the HADB server.
-
Restart the OS.
-
Execute the adbstart command to start the HADB server.
If the problem occurred on a client, restart the client's OS.
-
-
If there is still not enough shared memory after performing step 3, take the following action.
-
Execute the adbstop command to terminate the HADB server.
-
Change the kernel parameter settings to increase the maximum size of shared memory.
If you have applied HugePages to the HADB server's shared memory, make sure that the kernel parameters are set to make HugePages usable. For details, see 6.2 Estimating the kernel parameters.
-
Restart the OS.
-
Execute the adbstart command to start the HADB server.
If the problem occurred on a client, increase the maximum size of shared memory on the client. Then, restart the client's OS.
-
-
Re-execute the SQL statement or command.