Extended Shared Memory

Extended Shared Memoryallows a 32-bit process to allocate shared memory segments as small as one byte, rounded to the nearest page. This feature is available to processes that have the variable EXTSHM set to either ON, 1SEG, or MSEG in their process environment.

Extended Shared Memory essentially removes the limitation of only 11 shared memory regions. 64-bit processes are not affected by the EXTSHM variable.

Setting EXTSHM to ON has the same effect as setting the variable to 1SEG. With either setting, any shared memory less than 256 MB is created internally as a mmap segment, and thus has the same performance implications of mmap. Any shared memory greater or equal to 256 MB is created internally as a working segment.

If EXTSHM is set to MSEG, all shared memory is created internally as a mmap segment, allowing for better memory utilization.

There is no limit on the number of shared memory regions that a process can attach. File mapping is supported as before, but 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 have the same behavior.

Extended Shared Memory has the following restrictions:

  • I/O support is restricted in the same manner as for memory-mapped regions.
  • Only the uphysio() type of I/O is supported (no raw I/O).
  • These shared memory regions cannot be used as I/O buffers where the unpinning of the buffer occurs in an interrupt handler. For example, these regions cannot be used for async I/O buffers.
  • The segments cannot be pinned using the plock() subroutine because memory-mapped segments cannot be pinned with the plock() subroutine.