Hitachi

Hitachi Advanced Database Application Development Guide


C.2 Memory required for communication between an HADB client and the HADB server

Use the formula shown below to determine the size of the memory required for communication between an HADB client and the HADB server.

Formula (kilobytes)

Memory used during communication = RPCC + SBF + 256

Organization of this subsection

(1) How to obtain the value of RPCC

Use the following formula to obtain the value of RPCC (communication management information).

Formula (kilobytes)

[Figure]

SMSG: HADB server's transmission data size

For details about how to obtain SMSG, see the description of the SMSG variable in the following section in the HADB Setup and Operation Guide: Determining the variable RTHD_COMMUSZ in Determining the real thread private memory requirement (during normal operation) in Determining the memory requirement during normal operation

max_sql_concurrent_exec_num:

Maximum number of SQL statements that can be executed concurrently in one transaction

(2) How to obtain the value of SBF

The initial allocation size for SBF (transmission buffer) is 4,096 bytes.

If transmission data that is created exceeds the initial allocation size, an additional allocation is made of the size obtained from the following formula.

Formula (additional allocation) (kilobytes)

SBF = ↑CMSG ÷ 4,096↑ × 4

CMSG: Size of the transmission data from the HADB client

The size of the transmission data depends on the nature of the processing. The following table shows the size of the transmission data that is allocated for each type of processing.

Table C‒1: Size of transmission data that is allocated for each type of processing

No.

Type of processing

Formula for determining the transmission data size (bytes)

1

Preprocessing and execution

CMSG = clt_base_info + clt_exec_direct + clt_sql_text

2

Cursor open processing

CMSG = clt_base_info + clt_open + PARAM_DATA

3

SQL statement execution

CMSG = clt_base_info + clt_exec + PARAM_DATA

4

Preprocessing

CMSG = clt_base_info + clt_prepare + clt_sql_text

Legend:

clt_base_info: Basic information about transmission data

Assign 32 bytes.

clt_exec_direct: Information specific to preprocessing and execution

Assign 44 bytes.

clt_sql_text: Size of SQL text

Assign the length of the SQL statement to be executed (bytes).

clt_open: Information specific to cursor open processing

Assign 48 bytes.

clt_exec: Information specific to execution

Assign 48 bytes

clt_prepare: Information specific to preprocessing

Assign 44 bytes.

PARAM_DATA: Information about dynamic parameters

Use the following formula to obtain the value:

Formula (bytes)

[Figure]

param_num: Number of dynamic parameters specified in the SQL statement

param_size(i): Data size specified for each dynamic parameter

array_num: Number of sets of dynamic parameters updated in the batch mode#

#

The value depends on the application program implementation method:

  • Application programs that use CLI functions

    The value is the number specified in the ArrayCount argument of a_rdb_SQLBindArrayParams(). If the parameters were bound by using a_rdb_SQLBindParams(), the value is always 1.

  • Application programs that use a JDBC driver

    The value is the number of parameter lists registered by using the addBatch method. If you do not use executeBatch or executeLargeBatch, the value is always 1.