IBM Support

Finding which shared libraries are getting used by processes

Troubleshooting


Problem

How to find shared libraries and their associated processes on AIX

Environment

AIX

Diagnosing The Problem


To find the list of processes and their loaded libraries, use "genld -ld"  command.
The -l option  reports the lists of loaded objects for each process running on the system. 
The -d option shows the address and size of the Data section, in addition to the address and size of  the Text section. 

In this example we can see libraries and member objects being shared by different processes on the system

genld -ld

Proc_pid: 4456666 Proc_name: inetd
10000000 a785 20000cdb 55da inetd
d0580100 264e1 f0919d80 13f84 /usr/lib/libiconv.a[shr4.o]
d0572100 dcd4 f092e400 12f4 /usr/lib/libi18n.a[shr.o]
d056a000 2d75 d056e128 2334 /usr/lib/nls/loc/en_US
d0564000 319c f02c2000 43928 /usr/lib/libpthreads.a[shr_comm.o]
d072b100 2060f f03b7b00 2eb8 /usr/lib/libmlsenc.a[shr.o]
d0523000 3f30e f0306000 405c /usr/lib/libpthreads.a[shr_xpg5.o]
d05a7100 2217a f0226c18 96d8 /usr/lib/libodm.a[shr.o]
d0563100 9be f09186a8 120 /usr/lib/libcrypt.a[shr.o]
d0721100 9802 f03bbd50 13f4 /usr/lib/libmls.a[shr.o]
d0758100 1531a f02394d0 d044 /usr/lib/libsrc.a[shr.o]
d07b70f8 3e65 f03b60f8 0 /usr/lib/libbind.a[shr.o]
d07ac500 9b63 f03b49a8 1390 /usr/lib/libbsd.a[shr.o]
d0100100 4220a5 f083fd30 d7430 /usr/lib/libc.a[shr.o]

Proc_pid: 4915360 Proc_name: snmpdv3ne
10000000 36871 2000065b 1107d snmpdv3ne
d0580100 264e1 f0919d80 13f84 /usr/lib/libiconv.a[shr4.o]
d0572100 dcd4 f092e400 12f4 /usr/lib/libi18n.a[shr.o]
d056a000 2d75 d056e128 2334 /usr/lib/nls/loc/en_US
d05a7100 2217a f0226c18 96d8 /usr/lib/libodm.a[shr.o]
d05ca100 15d5f f0231780 646c /usr/lib/libcfg.a[shr.o]
d0563100 9be f09186a8 120 /usr/lib/libcrypt.a[shr.o]
d0758100 1531a f02394d0 d044 /usr/lib/libsrc.a[shr.o]
d11b0100 d903 f0441820 5c46 /usr/lib/libdpi20.a[shr.o]
d10ef100 c0885 f04499a8 32688 /usr/lib/libsnmppriv_ne.a[shr.o]
d0100100 4220a5 f083fd30 d7430 /usr/lib/libc.a[shr.o]

For eg:                                                                   
genld -ld | grep libptool                                                 
         d3ad9100   44571         f0d38240  1da104                        
/usr/lib/libptools.a[shr.o]                                               
                                                                          
Here 44571 is the text instance's size and 1da104 indicates size for the data instance(data+bss)   Since genld lists loaded libraries for each process on the system, it can help find which libraries and how much memory is consumed in terms of its text and data instances, loaded in the shared library space.  

[{"Product":{"code":"SWG10","label":"AIX"},"Business Unit":{"code":"BU058","label":"IBM Infrastructure w\/TPS"},"Component":"--","Platform":[{"code":"PF002","label":"AIX"}],"Version":"7.1","Edition":"Enterprise","Line of Business":{"code":"LOB08","label":"Cognitive Systems"}}]

Document Information

Modified date:
15 September 2021

UID

isg3T1026446