OSI/MHS Gateway Programmatic Interface (GPI) Programming Guide

Writing Your Program
OSI/MHS Gateway Programmatic Interface (GPI) Programming Guide424822-001
5-10
Initializing the GPI Environment
It might be helpful to extend this example to include sample calculations for swap
memory requirements. The formulas used in the following calculations were introduced
in two previous subsections,Determining GPI Library Memory Requirements” and
“Determining GIP Memory Requirements.”
In this example, suppose that the client process uses only one session and that no
more than two objects will exist at the same time. Considering that the default values of
GPI_INITIALIZE_ parameters are used, the calculation of total swap memory required
is:
max-table-data = ZGPI_DEFAULT_OT_DATA_LEN (2,097,152)
max-table-entries = ZGPI_DEFAULT_OT_TBL_ENTRIES (10,000)
num_objects = 2 num_sessions = 1
OT_memory = max-table-data + (28 x max-table-entries)
= 2,097,152 + (28 x 10,000) = 2, 377,152
GPILIB_memory = 524,288 + (OT_memory x num_objects)
= 524,288 + (2,377,152 x 2) = 5,278,592
GIP_memory = (4,194,304 + OT_memory) x num_sessions
= (4,194,304 + 2,377,152) x 1 = 6,571,456
Total memory required
= GPILIB_memory + GIP_memory
= 5,278,592+ 6,571,456
= 11,850,048 (11.8 megabytes)
Suppose you use the maximum rather than default value of max-table-entries.
In that case, the calculation for total required memory space is:
max-table-data = ZGPI_DEFAULT_OT_DATA_LEN (2,097,152)
max-table-entries = ZGPI_MAX_OT_TBL_ENTRIES (1,048,576)
num_objects = 2 num_sessions = 1
OT_memory = max-table-data + (28 x max-table-entries)
= 2,097,152 + (28 x 1,048,576) = 31,457,280
GPILIB_memory = 524,288 + (OT_memory x num_objects)
= 524,288 + (31,457,280 x 2) = 63,438,848
GIP_memory = (4,194,304 + OT_memory) x num_sessions
= (4,194,304 + 31,457,280) x 1 = 35,651,584
Total memory required
= GPILIB_memory + GIP_memory
= 63,438,848+ 35,651,584 = 99,090,432 (99.1 megabytes)
Finally, suppose you use the maximum values for max-table-entries and
max-table-data. The calculation for total required memory space now is:
max-table-data = ZGPI_MAX_OT_DATA_LEN (10,485,760)
max-table-entries = ZGPI_MAX_OT_TBL_ENTRIES (1,048,576)
num_objects = 2 num_sessions = 1
OT_memory = max-table-data + (28 x max-table-entries)
= 10,485,760 + (28 x 1,048,576) = 39,845,888
GPILIB_memory = 524,288 + (OT_memory x num_objects)
= 524,288 + (39,845,888 x 2) = 80,216,064
GIP_memory = ((2 x max-table-data)+ OT_memory) x num_sessions
= (20,971,520+ 39,845,888) x 1 = 60,817,408
Total memory required
= GPILIB_memory + GIP_memory
= 80,216,064+ 60,817,408 = 141,033,472 (141.0 megabytes)