Memory leak from unloading SNA libraries

Technote (troubleshooting)


Problem(Abstract)

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 this process of dynamically loading and unloading SNA libraries repeatedly occurs in a process, and the process does not exit, memory will be used and not freed each time this occurs.

Cause

The SNA libraries are not designed to be dynamically unloaded prior to the end of the process. When the 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 would be unpredictable if the library were reloaded. The APPC, CPI-C, and LUA libraries may fail in unpredictable ways. The CSV library may work but will 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, this can cause the SNA libraries to be unloaded without explicitly targeting the SNA libraries. To prevent this, LDR_PRELOAD can be used to explicitly load the SNA libraries prior to loading the shared library that uses them. If the SNA libraries are already loaded before the shared library that needs them is loaded, then they will not be unloaded when that shared library is unloaded.

When the process using the SNA libraries ends, all memory it is using will be released.

For reference, these libraries include any library found in /usr/lib/sna/ on AIX and /opt/ibm/sna/lib/ and /opt/ibm/sna/lib64/ on Linux.


Cross reference information
Segment Product Component Platform Version Edition
Networking Communications Server for Linux All Linux xSeries 6.0.1, 6.2, 6.2.1, 6.2.2, 6.2.3, 6.2.3.1, 6.2.3.2, 6.2.3.3, 6.4, 6.4.0.1, 6.4.0.2, 6.4.0.3, 6.4.0.4, 7.0.0.0
Networking Communications Server for Linux on zSeries All Linux zSeries 6.0.1, 6.2, 6.2.1, 6.2.2, 6.2.3, 6.2.3.1, 6.4, 6.2.3.2, 6.4.0.1, 6.4.0.2, 6.4.0.3, 6.4.0.4, 7.0.0.0
Networking IBM Communications Server for Data Center Deployment All AIX, Linux, Linux on System z 7.0.0.0

Product Alias/Synonym

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

Rate this page:

(0 users)Average rating

Add comments

Document information


More support for:

Communications Server for AIX
All

Software 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

Operating system(s):

AIX

Reference #:

1508698

Modified date:

2011-08-16

Translate my page

Machine Translation

Content navigation