16.2.2 Calculation of required memory

The size of the memory required for each unit of a HiRDB/Parallel Server is the sum of the items listed in Table 16-7.

For details about the value specified in the shmmax operating system parameter (for Solaris, shmsys:shminfo_shmmax; for Linux, SHMMAX), see 21. Specifying OS Parameters.

Table 16-7 Size of memory required for each unit of a HiRDB/Parallel Server

ItemRequired memory (KB)
Process private areaProcess private area used by all unit controller processes
  • 32-bit mode
J + K[Figure] Number of FESs in unit + L[Figure] (Number of BESs in unit + Number of DSs in unit) + [Figure]{(64 + 48 [Figure] (v + 1)) [Figure] (value of pd_max_server_process - w) + z} [Figure] 1024[Figure]
  • 64-bit mode
J + K[Figure] Number of FESs in unit + L[Figure] (Number of BESs in unit + Number of DSs in unit) + [Figure]{(64 + 64 [Figure] (v + 1)) [Figure] (value of pd_max_server_process - w) + z} [Figure] 1024[Figure]
  • If a plug-in is used, add:
+ 1400
  • If the asynchronous READ facility is used, add:
+ s
  • If Real Time SAN Replication is used, add:
+ [Figure](A + B + C) [Figure] 1024 [Figure]
  • If fixed is specified in the pd_process_terminator operand, add:
+ M[Figure] (value of pd_process_terminator_max - 1)
Process private area used by each server process1, 2Front-end server(N + h + m + p + q) [Figure] (b + 3) + 100 + y
Dictionary serverpd_work_buff_mode=each specified{(P + i + m + r + t) [Figure] (b + 3)} +
(a + 9) [Figure] 2 + 100 + y
pd_work_buff_ mode=pool specified or omitted{(P + i + m + r + t) [Figure] (b + 3)}
+ a + 9 + [Figure] a [Figure] 128 [Figure] 0.1[Figure] + 100 + n + y
Back-end serverpd_work_buff_ mode=each specified{Q + g + (a + 9) [Figure] c + i + m + r + t}
[Figure](b + 3) + 100 + y
pd_work_buff_ mode=pool specified or omitted
  • 32-bit mode
(Q + g + a + 9
+ [Figure] a [Figure] 128 [Figure] 0.1 + 11[Figure] + i + m + r + t)
[Figure](b + 3) + 100 + n + y
  • 64-bit mode
(Q + g + a + 9
+ [Figure] a [Figure] 128 [Figure] 0.1 + 15[Figure] + i + r + t)
[Figure] (b + 3) + 100 + n + y
Shared memorySpace used by the unit controller in the unit controller shared memory[Figure]d[Figure] 1024[Figure]
Space used by each server in the unit controller shared memory1e
Global buffer shared memoryf
Utility shared memoryu
Security audit information buffer shared memory[Figure]For automatic calculation by the system:
[Figure] 0.3 + MAX{(R + 100), (R[Figure] 1.2)} [Figure] 0.25 [Figure]
[Figure] For user-specified values (specify the pd_audit_def_buffer_size operand):
[Figure] 0.3 + R[Figure] 0.25 [Figure]
Inter-process memory communication shared memory3j [Figure]k
1 If the unit contains multiple servers (excluding the system manager), obtain the value for each server.
2 If plug-ins are used, add 300 per process.

3 Add this value if you have specified PDIPC=MEMORY in the client environment definition. For details about the inter-process memory communication facility and client environment definitions, see the manual HiRDB Version 8 UAP Development Guide. If either the HiRDB server or the HiRDB client is in 32-bit mode, the system allocates the shared memory for the inter-process memory communication facility in the 32-bit address space.

a: Value of pd_work_buff_size operand
b: Value of pd_max_users operand + value of pd_max_reflect_process_count operand
  • For a dictionary server, the value is (value of the pd_max_dic_process operand + value of the pd_max_reflect_process_count operand).
  • For a back-end server, the value is (value of the pd_max_bes_process operand + value of the pd_max_reflect_process_count operand).
  • If the pd_max_dic_process or pd_max_bes_process operand is omitted, the value is (value of the pd_max_users operand + value of the pd_max_reflect_process_count operand).
c: Maximum number of work tables
From Table 16-8, obtain the number of work tables per SQL statement. Use the largest number of work tables obtained from Table 16-8 as the maximum number of work tables.
d: Value obtained from 16.2.3 Formulas for shared memory used by a unit controller.
e: Value obtained from 16.2.4 Formulas for shared memory used by each server.
f: Value obtained from 16.2.5 Formula for size of shared memory used by global buffers.
g: Size of memory required during SQL execution
For details about the formula, see 16.2.6 Formulas for size of memory required during SQL execution.
h: Size of memory required during SQL preprocessing
For details about the formula, see 16.2.7 Formula for size of memory required during SQL preprocessing.
i: LOB buffer batch input/output work memory
Add 62 KB if LOB global buffer is specified for the LOB RDAREA for the corresponding server (-b specified in the pdbuffer operand of the system common definition).
j: Maximum number of concurrently executable clients that use the inter-process memory communication facility.
If you are not sure about the value, specify the number of all clients that use the inter-process memory communication facility or the value of the pd_max_users operand.
k: Average memory size for data transfer performed by all clients that use the inter-process memory communication facility (value of PDSENDMEMSIZE + value of PDRECVMEMSIZE in the client environment definition).
m: Memory requirement for a Java virtual machine
If you use Java stored procedures or Java stored functions, add the size of memory used by the Java virtual machine. This value depends on the Java virtual machine's options (-Xms, -Xmx, and -Xmn options for Hewlett-Packard JRE 1.2.2.04) and version. For details about the memory requirement for your Java virtual machine, see the applicable manual. Following are the guidelines for the memory required for HP-UX:
  • Eight MB of memory is required to start a Java virtual machine.
  • Add the maximum memory size for the Java virtual machine (value of the -Xmx option). Note that some Java virtual machines may use more memory than the size specified in the -Xmx option.
n: Work table extended memory size
When the pd_work_buff_expand_limit operand is specified, add the work table extended memory size. The work table extended memory size is determined from the following formula:
Work table extended memory size (kilobytes) = work table extended buffer size + [Figure](work table extended buffer size [Figure] 128) [Figure] 0.1[Figure]
  • Work table extended buffer size (kilobytes) = MAX(0, work table extended buffer size based on hash join, subquery hash execution) + MAX(0, work table extended buffer size based on the increase in the number of work tables)
  • Work table extended buffer size based on hash join, subquery hash execution = MIN{ (work table extended buffer size based on hash join, subquery hash execution - value of the pd_work_buff_size operand), (value of the pd_work_buff_expand_limit operand - value of the pd_work_buff_size operand) } [Figure] number of concurrently executing users executing hash join, subquery hash execution
    For details about determining the work table extended buffer size when executing hash joins, subquery hash executions, see the manual HiRDB Version 8 UAP Development Guide.
  • Work table extended buffer size based on the increase in the number of work tables = MIN{ (number of work tables used [Figure] 128 - value of the pd_work_buff_size operand), (value of pd_work_buff_expand_limit operand - value of pd_work_buff_size operand) }[Figure](number of users such that the number of work tables is greater than the value of the pd_work_buff_size operand[Figure]128)
    Number of work tables used = MAX(number of work table files used per SQL statement, number of work table files used by the ASSIGN LIST statement)
    For details about determining the number of work table files used per SQL statement and the number of work table files used by the ASSIGN LIST statement, see 19.3 Determining the maximum number of files (pdfmkfs -l command).
p: Memory requirements required for BLOB data type
For details about the formula, see 16.2.8 Formula for size of memory required during BLOB data retrieval or updating (front-end server).
q: Memory requirements required for server-side block transfer or array FETCH
For details about the formula, see 16.2.10 Formula for size of memory required during block transfer or array FETCH (front-end server).
r: Memory requirements required for BLOB data type
For details about the formula, see 16.2.9 Formula for size of memory required during BLOB data retrieval or updating (back-end server or dictionary server).
s: Memory size used by asynchronous READ
This is applicable when the asynchronous READ facility is used; use the following formula (in kilobytes) for the calculation:
(90 +
90
[Figure]Memory used by the RDAREA for management of the HiRDB file system area)
i=1
[Figure]value of pd_max_ard_process
For the memory used by the RDAREA for management of the HiRDB file system area, use the largest 90 areas in descending order of the values. If the number of areas used by the server is fewer than 90, assume that amount anyway.
The memory used by the RDAREA for management of the HiRDB file system area (in kilobytes) is calculated from the following formula based on the initial settings:
{(Number of files1 + number of extensions2)[Figure]64}[Figure]1.53
1 Value specified by pdfmkfs -l.
2 Value specified by pdfmkfs -e.
3 Multiply when the area size (value specified in pdfmkfs -n) is at least 2048.
t: HiRDB file system memory size
Determine with the following formula (in kilobytes):
347 + Memory used by the work tables for management of the HiRDB file system area + Memory used by the system logs for management of the HiRDB file system area +
90
[Figure]memory used by the RDAREA for management of the HiRDB file system area
i=1
The memory used by the HiRDB file system area for management of work tables and system logs uses the maximum value calculated for the memory used by the HiRDB file system area for management used by the server. For RDAREAs, use the largest 90 areas in descending order of the values. If the number of areas used by the server is fewer than 90, use as many areas as are used for the calculation.
The memory used by the RDAREA for management of the HiRDB file system area (in kilobytes) is calculated with the following formula based on the initial settings:
{(Number of files1 + number of extensions2)[Figure]64}[Figure]1.53
1 Value specified by pdfmkfs -l.
2 Value specified by pdfmkfs -e.
3 Multiply when the area size (value specified in pdfmkfs -n) is at least 2048.
u: When value of pd_utl_exec_mode is 0: 0
When value of pd_utl_exec_mode is 1: [Figure]{(b[Figure]2000 + 136)[Figure]1024}[Figure][Figure]1024
v: Value of pd_module_trace_max that is valid as the unit control information definition
w: Sum of (maximum number of processes that can be started + 3) for all server processes in the unit
For details about the maximum number of processes that can be started, see the manual HiRDB Version 8 System Definition.
y: Sum of the values obtained by the following formula for each server process in the unit:
In the 32-bit mode:
[Figure]{(64 + 48 [Figure] (value of pd_module_trace_max + 1)) [Figure] (maximum number of processes that can be started + 3)} [Figure] 1024[Figure]
In the 64-bit mode:
[Figure]{(64 + 64 [Figure] (value of pd_module_trace_max + 1)) [Figure] (maximum number of processes that can be started + 3)} [Figure] 1024[Figure]
For details about the maximum number of processes that can be started, see the manual HiRDB Version 8 System Definition.
z: Memory size for restarting HiRDB
If this memory size cannot be allocated, HiRDB restart fails. Use the following formula to determine the size (in bytes):
(D + E + F) [Figure] number of dictionary servers + (D + E + F + G) [Figure] number of back-end servers + [Figure]H
Use the following variables for the formula to calculate the size of memory used by HiRDB to restart:
VariableValue
D
  • 32-bit mode
291722 + 4 [Figure] value of pd_max_rdarea_no
+ {48 [Figure] (value of pd_max_rdarea_no + number of tables) + 304} [Figure] (value of pd_max_users[Figure] 2 + 7)
  • 64-bit mode
370682 + 8 [Figure] value of pd_max_rdarea_no
+ {64 [Figure] (value of pd_max_rdarea_no + number of tables) + 512} [Figure] (value of pd_max_users[Figure] 2 + 7)
Number of tables: Number of data dictionary tables + MAX {value of pd_max_access_tables, 500}
Eb1[Figure] X + b2[Figure] Y
b1: When the record length of the server status file < 4096
MAX(([Figure](3400 [Figure] (([Figure]((record length - 40) - 308) [Figure] 20[Figure])
+ ([Figure](record length - 40) [Figure] 20[Figure]) [Figure] (MAX([Figure]4096 [Figure] record length[Figure],2) - 1))
+ 0.7)[Figure]),1) [Figure] MAX([Figure]4096 [Figure] record length[Figure],2) [Figure] (record length - 40)
When 4096 [Figure] record length of server status file < 12288
MAX([Figure](3400 [Figure] ([Figure](((record length - 40) - 308) [Figure] 20)[Figure]) + 0.7)[Figure],1)
[Figure](record length - 40)
When 12288 [Figure] record length of server status file
MAX([Figure](3400 [Figure] ([Figure](((record length - 40) - 836) [Figure] 20)[Figure]) + 0.7)[Figure],1)
[Figure](record length - 40)
X: When the number of RDAREAS in server [Figure] 3400: 1
When 3401 [Figure] number of RDAREAS in server [Figure] 6800: 2
When 6801 [Figure] number of RDAREAS in server: 3
b2: When the record length of the status file for server < 4096
([Figure](5662310​ [Figure] (([Figure]((record length - 40) - 308) [Figure] 20[Figure])
+ ([Figure](record length - 40) [Figure] 20[Figure]) [Figure] (MAX([Figure]4096 [Figure] record length[Figure],2) - 1))
+ 0.7)[Figure]) [Figure] MAX([Figure]4096 [Figure] record length[Figure],2) [Figure] (record length - 40)
When 4096 [Figure] record length of server status file < 12288
[Figure](5662310​ [Figure] ([Figure](((record length - 40) - 308) [Figure] 20)[Figure]) + 0.7)[Figure]
[Figure] (record length - 40)
When 12288 [Figure] record length of server status file
[Figure](5662310​ [Figure] ([Figure](((record length - 40) - 836) [Figure] 20)[Figure]) + 0.7)[Figure]
[Figure] (record length - 40)
Y: When the number of RDAREAS in server [Figure] 10200: 0
When 10201 [Figure] number of RDAREAS in server [Figure] 5672510​: 1
When 5672511​ [Figure] number of RDAREAS in server [Figure] 11334820​: 2
When 11334821​ [Figure] number of RDAREAS in server: 3
FIf commit is specified in the pd_dbsync_point operand, add:
+ 112 [Figure] (value of pd_max_users[Figure] 2 + 7)
GIf 1 or a greater value is specified in the pd_inner_replica_control operand, add:
  • 32-bit mode
(48 [Figure] value of pd_inner_replica_control + 80) [Figure] (value of pd_max_users[Figure] 2 + 7)
  • 64-bit mode
(64 [Figure] value of pd_inner_replica_control + 160) [Figure] (value of pd_max_users[Figure] 2 + 7)
HFor a back-end server, if the number of RDAREA storage areas created in a character special file is 1001 or greater in the server, add:
  • 32-bit mode
12012 [Figure] ([Figure](number of RDAREA storage areas created in a character special file - 1000) [Figure] 1000[Figure])
  • 64-bit mode
16016 [Figure] ([Figure](number of RDAREA storage areas created in a character special file - 1000) [Figure] 1000[Figure])
A: 425 [Figure] (2 [Figure] b + 7) [Figure] Number of FESs in unit
B: 425 [Figure] (2 [Figure] b + 7) [Figure] Number of DSs in unit
C: 425 [Figure] (2 [Figure] b + 7) [Figure] Number of BESs in unit
J, K, L, M, N, P, Q: Fixed value
These values depend on the OS being used. The following table presents the values for each OS (in kilobytes):
OSValue of JValue of KValue of LValue of MValue of NValue of PValue of Q
HP-UX (32-bit mode)74,3009,30012,1002,7004,1003,5004,200
HP-UX (32-bit-mode POSIX library version)120,7009,70012,3002,8004,2003,6004,300
HP-UX (64-bit mode)75,80010,20013,0002,8004,4003,9005,400
HP-UX (IPF)154,30010,30013,1002,7004,7005,3007,400
AIX 5L (32-bit mode)64,2008,50010,8002,2004,8004,3005,100
AIX 5L (32-bit-mode POSIX library version)116,90016,70019,2005,0007,6007,4008,300
AIX 5L (64-bit mode)72,10010,30013,2002,8006,3005,7007,300
Solaris (32-bit mode)69,6006,0007,5001,4002,6002,1004,100
Solaris (32-bit-mode POSIX library version)117,8006,7006,1001,6002,8002,3004,200
Solaris (64-bit mode)80,1007,5009,5001,9003,3002,7006,100
Linux (32-bit mode)84,40011,50015,0003,3004,4003,9003,800
Linux (IPF)151,600151,60020,5004,7006,3006,8007,300
Linux (EM64T)121,10026,30035,2007,60011,10012,90012,500
R: The number of objects specified in a narrowed search using the security audit facility audit trail

Table 16-8 Procedure for obtaining the number of work tables for each SQL statement

SQL statementProcedure for obtaining the number of work tables
SELECT statement
INSERT(-SELECT) statement
When none of 1-8 as follows are applicable: 0
When any of 1-8 as follows are applicable: Sum of the applicable values from 1-8
  1. When multiple tables are joined for retrieval
    Number of additional work tables = (Number of joined tables - 1) [Figure] 2 + 1
  2. When specifying the ORDER BY clause
    Number of additional work tables = 2
  3. When specifying the GROUP BY clause
    Number of additional work tables = Number of GROUP BY clauses specified
  4. When specifying the DISTINCT clause
    Number of additional work tables = Number of DISTINCT clauses specified
  5. When specifying the UNION, UNION ALL, or EXCEPT[ALL] clause
    Number of additional work tables = (Number of UNION or UNION ALL clauses specified) [Figure] 2 + 1
  6. When search condition contains columns with index defined
    Number of additional work tables = Number of columns with index defined in the search condition
  7. When specifying the FOR UPDATE or FOR READ ONLY clause
    Number of additional work tables = 1
  8. When specifying a subquery (quantified predicate)
    Number of additional work tables = Number of subqueries specified
UPDATE statement
DELETE statement
Number of columns with index defined in the search condition + 1
DROP SCHEMA statement
DROP TABLE statement
DROP INDEX statement
CREATE INDEX statement
REVOKE statement to revoke access privilege
2