IBM Support

How to avoid 'out of virtual shared memory' on AIX 32-bit platform

Troubleshooting


Problem

Informix engine couldn't allocate any more virtual shared memory throwing out "Out of virtual shared memory, cannot grow exception stack shmat: [EMFILE][24]: out of shared memory segments, check system SHMSEG" error messages, and the engine hangs.

Symptom

"Out of virtual shared memory, cannot grow exception stack shmat: [EMFILE][24]: out of shared memory segments, check system SHMSEG" error messages.

Resolving The Problem


On AIX 32-bit runtime environment, there are several limits and default settings which will possibly result in the out of virtual shared memory problem. If properly set up the relevant parameters and environment variable of Informix, to some extent the out of virtual shared memory problem can be avoided.


    1. The maximum size of each shared memory segment by default is 256 MB on AIX 32-bit. Therefore try to have proper onconfig settings ("SHMVIRTSIZE" and "SHMADD") so that shared memory segments will be allocated in 256 MB pieces. Other settings will waste memory.

    2. The number of shared memory segments are limited to 11 (for application allocated shared memory). Other additional 5 segments are reserved for special purposes (kernel, text, libraries, etc.).Therefore try to avoid using shared memory connection protocol (onipcshm), as these shared memory segments will be fairly small and thus waste memory. Instead use TCP connection protocol only.

    3. AIX introduced the EXTSHM environment variable to support use of the extended shared memory model. To use this memory model, export the variable "EXTSHM=ON" in the environment of the process. By default, a program running under AIX may only attach 11 shared memory segments in the process address space. Setting the environment variable "EXTSHM=ON" allows many more segments to be attached.

    4. Monitoring the system with 'onstat -g seg' and 'ipcs -am', to make sure the allocated segments not getting the limitation.

    [{"Product":{"code":"SSGU8G","label":"Informix Servers"},"Business Unit":{"code":"BU053","label":"Cloud & Data Platform"},"Component":"--","Platform":[{"code":"PF002","label":"AIX"}],"Version":"10.0;11.1;7.3;9.4;11.5","Edition":"","Line of Business":{"code":"","label":""}}]

    Document Information

    Modified date:
    03 June 2021

    UID

    swg21409734