This blog covers the basics of shared memory segments used by TXSeries on AIX and increasing the shared memory available to applications using LDR_CTRL=MAXDATA settings.
TXSeries is a 32-bit product and works based on 32 bit virtual memory model of AIX. The total virtual address space of a CICS application server process (cicsas) is restricted to 4GB. In 32-bit AIX memory model, the address space is divided into 16 segments with each occupying 256 MB memory (256MB *16=4GB). The addressable memory segments are from 0 (0x00000000) to F (0xFFFFFFFF).
Segment 0 is reserved for Kernel data and text.
Segment 1 is for application program text.
Segment 2 is for stack and application program data.
Segment D is the shared library text
Segment E is also shared memory and miscellaneous kernel usage
Segment F is the per-process shared library data.
With 6 segments occupied , 10 segments are left for applications to attach. In TXSeries, the cicsas process use large memory model of AIX to allow large values for task private pool.
This large memory model for cicsas can be verified from the following command:
file –m/etc/magic /usr/lpp/cics/bin/cicsas
/usr/lpp/cics/bin/cicsas: executable (RISC System/6000) or object module not stripped (maxdata=4)
(Using a modified magic file described in “Developing and Porting C and C++ Applications on AIX”)
Hence, 4 segments of memory (1 GB) is reserved for heap.
There are only 6 segments remaining. Assuming the size of region pool and task shared pool to be less than 256 MB, each occupies a segment(0xA and 0xB by default). TXSeries uses a shared memory segment for CICS IPC (CIPC) communication which is usually 7th segment by default.
Now, the number of available shared memory segment is reduced to 3. The application library getting loaded in the CICSAS process such as user application,db2 client library, MQ library,Oracle client library etc (depending on the configuration ) will have 3 free shared memory segments to attach. An error will be raised when the loaded application or library attempts to attach more than 3 segments.
Sometimes, there is a possibility of hitting these limits when there are multiple resource managers configured in a region.One way to address the issue is to reduce the size of heap. If the user application does not require large heap, LDR_CTRL=MAXDATA can be used to increase the shared memory available for application by reducing the heap. If you set LDR_CTRL=MAXDATA=0x20000000 in region's environment file, then the heap memory can be restricted to 2 segments i.e. 512MB (instead of 4 segments) and additional 2 segments becomes available to the application.