By using the shmat() or mmap() subroutines, files can be explicitly mapped into memory. This avoids buffering and avoids system-call overhead. The memory areas are known as the shared memory segments or regions. Beginning with AIX 4.2.1 and only affecting 32-bit applications, segment 14 was released providing 11 shared memory segments (not including the shared library data or shared library text segments) for processes (segments 3-12 and 14). Each of these segments are 256 MB in size. Applications can read/write the file by reading/writing in the segment. Applications can avoid overhead of read/write system calls simply by manipulating pointers in these mapped segments.
Files or data can also be shared among multiple processes/threads. However, this requires synchronization between these processes/threads and its handling is up to the application. Typical use is by database applications for use as a large database buffer cache.
Paging space is allocated for shared memory regions just as it would for the process private segment (paging space is used as soon as the pages are touched if deferred page space allocation policy is off).
By default, each shared memory region (whatever its size), always consumes a 256 MB region of address space. AIX 4.2.1 and later implements Extended Shared Memory, which allows for more granular shared memory regions that can be in size of 1 byte up to 256 MB. However, the address space consumption will be rounded up to the next page (4096 byte) boundary. Extended Shared Memory essentially removes the limitation of only 11 shared memory regions, but note that when using EXTSHM, the mmap services are actually used and thus will have the same performance implications of mmap.
This feature is available to processes that have the variable EXTSHM set to ON (EXTSHM=ON) in their process environment. There is no limit on the number of shared memory regions that a process can attach. File mapping is supported as before, but still consumes address space that is a multiple of 256 MB (segment size). Resizing a shared memory region is not supported in this mode. Kernel processes will still have the same behavior. Without this environment variable set, eleven 256 MB regions are available.
Extended Shared Memory has the following restrictions: