====== Problem with shared memory ======
If you have high swap space usage, or defunct processes, the stop all application and cleanup the shared memory segments, queues and semaphores
Remove defunct interprocess communication segments.
==== Memory ====
List all memory segments:
$ ipcs -am | grep db2inst1
IPC status from as of Thu Aug 30 13:16:55 2001
T ID KEY MODE OWNER GROUP
Shared Memory:
m 9910 0x74006380 --rw-rw-rw- db2inst1 db2grp
m 59714 0x61006380 --rw------- db2inst1 db2grp
From the list above, you notice that there are two memory segments that were not removed when executing ipclean. You must remove them manually:
$ ipcrm -m 9910
$ ipcrm -m 59714
==== Semaphore ====
List all semaphore segments:
$ ipcs -as | grep db2inst1
IPC status from as of Thu Aug 30 13:16:55 2001
T ID KEY MODE OWNER GROUP
Shared Memory:
s 1900549 0x74006380 --ra-ra-ra- db2inst1 db2grp 1
s 1310727 00000000 --ra-ra---- db2inst1 db2grp 1
s 2031624 0x73006380 --ra-ra-ra- db2inst1 db2grp 1
From the list above, notice that there are three semaphore segments that were not removed after executing ipclean. You must remove them manually:
$ ipcrm -s 1900549
$ ipcrm -s 1310727
$ ipcrm -s 2031624
==== Queues ====
List all message queue segments:
$ ipcs -aq | grep db2inst1
IPC status from as of Thu Aug 30 13:16:55 2001
T ID KEY MODE OWNER GROUP
Shared Memory:
q 1572868 0x01dadd16 -Rrw------- db2inst1 db2grp 65535
q 901125 0x01eba5ed --rw------- db2inst1 db2grp 65535
q 1609739 00000000 --rw------- db2inst1 db2grp 65535
q 659468 00000000 -Rrw------- db2inst1 db2grp 65535
From the list above, notice that there are four message queue segments that were not removed after executing ipclean. You must remove them manually:
$ ipcrm -q 1572868
$ ipcrm -q 901125
$ ipcrm -q 1609739
$ ipcrm -q 659468