Database Shared Memory segments cannot be removed when following instructions in Article:
The reason is because there are processes still attached to shared memory. The following information further clarifies this situation and was extracted from a RedHat solution:
Why shared memory can not be released by "ipcrm" command ?Link (requires login account to RedHat support):
https://access.redhat.com/solutions/39532
VERIFIED - Updated August 16 2014 at 4:04 PM
Environment
Red Hat Enterprise Linux 5
Red Hat Enterprise Linux 6
Shared Memory, ipcrm, ipcs
Issue Why shared memory can not be released by "ipcrm" command ?
How to remove shared memory segment ?
What is the meaning of the "dest" seen under status from the output of the "ipcs -m" command ? Tried to remove shared memory segment with shmid
(4685833) using ipcrm command.
$ ipcrm -m 4685833
The shared memory segment with shmid
(4685833) still present,
marked to be destroyed on the system.:
$ ipcs -m
------ Shared Memory Segments --------
key shmid owner perms bytes nattch status
0x74000157 3473408 root 600 4 0
0x7400012d 4161537 root 600 4 0
0x74000190 851970 root 600 4 0
0x00000000 4521987 root 644 80 2
0x7400012c 4128772 root 600 4 0
0x00000000 4554757 root 644 16384 2
0x00000000 4587526 root 644 280 2
0x00000000 4620295 root 644 64 2 dest
0x00000000 4653064 root 644 16384 2 dest
0x00000000 4685833 root 644 280 2 dest
Resolution:
In the output of
"ipcs -m"
- "dest" status means memory segment is marked to be destroyed
- "nattach" field shows how many application pid's are still attached to the shared memory
Steps to remove shared memory segment:
A shared memory segment marked as
"dest" , will release its memory only when all the application pid's that are attached with this memory segment are terminated:
1. Determine the application pid's which are using the shared memory segment.
Identify the process id using one of the following commands:
$ ipcs -mp
$ egrep -l "shmid" /proc/[1-9]*/maps
$ lsof | egrep "shmid"
2. Terminate all application pid's that are still using shared memory segment:
$ kill -15 <pid>
2. Remove the shared memory segment.
$ ipcrm -m shmid