IBM Support

Memory leak from unloading SNA libraries

Troubleshooting


Problem

When a program dynamically unloads one of the SNA libraries, but the program does not exit, the memory usage of that program can grow a little. If SNA libraries are repeatedly dynamically loaded and unloaded, and the process does not exit, memory might not be freed on each occurrence.

Cause

The SNA libraries are not designed to be unloaded dynamically before a process ends. When a SNA library is loaded, it creates a thread to communicate with the kernel drivers. This thread has to operate asynchronously to receive information from the kernel. The behavior is unpredictable if the library is reloaded. The APPC, CPI-C, and LUA libraries might fail in unpredictable ways. The CSV library might work but can exhibit a memory leak.

Resolving The Problem

Do not explicitly unload the SNA libraries.

In some cases, if the SNA libraries are used by another shared library that is dynamically loaded and unloaded, the SNA libraries can be unloaded without explicitly targeting the SNA libraries. To prevent unloading of SNA libraries by other shared libraries, LDR_PRELOAD can be used to explicitly load the SNA libraries before loading the shared library that uses them. If the SNA libraries are already loaded before the shared library that needs them is loaded, they are not unloaded when that shared library is unloaded.

When the process that uses SNA libraries ends, all memory it using is released.

For reference, these libraries include any library found in

/usr/lib/sna/

On AIX,
/opt/ibm/sna/lib/ , /opt/ibm/sna/lib64/
On Linux.

[{"Line of Business":{"code":"LOB35","label":"Mainframe SW"},"Business Unit":{"code":"BU058","label":"IBM Infrastructure w\/TPS"},"Product":{"code":"SSPQKF","label":"Communications Server for AIX"},"ARM Category":[{"code":"","label":""}],"Platform":[{"code":"PF002","label":"AIX"}],"Version":"5.0;6.0;6.1;6.3;6.3.1;6.4;6.4.0.1;6.4.0.2;6.4.0.3;6.4.0.4;7.0.0.0"},{"Line of Business":{"code":"LOB35","label":"Mainframe SW"},"Business Unit":{"code":"BU058","label":"IBM Infrastructure w\/TPS"},"Product":{"code":"SSKK8Z","label":"Communications Server for Data Center Deployment"},"ARM Category":[{"code":"a8m0z0000001jShAAI","label":"Comm Server DSD AIX V7"},{"code":"a8m0z0000001jSmAAI","label":"Comm Server DSD Linux V7"}],"Platform":[{"code":"PF025","label":"Platform Independent"}],"Version":"All Versions","Type":"MASTER"}]

Product Synonym

csaix cs/aix commserver comm server aix sna aixsna csl cslinux

Document Information

Modified date:
24 October 2022

UID

swg21508698