Once you have found what processes needs to be killed to free up the shared memory table, you can run “ipcsrm” command to do that.
# ipcrm -m PID (you can find this on the 2nd column)
OR
You can copy the code below to clear all the processes within the shared memory segment.
*****************************
#!/usr/bin/ksh
#
# Script to clean up shared memory segments that are no longer in use.
#
#
LOGFILE=/tmp/ipcClean.log
date ‘+%d/%m/%y %H:%M’ >> ${LOGFILE}
for shmid in $(ipcs -mo|sed -e ’s/^m//’|egrep “[ , ]0$”|awk ‘{ print $1 }’)
do
echo “Removing shared memory segment $shmid”
ipcrm -m $shmid
done >> ${LOGFILE} 2>&1
*****************************
NOTE: If you want to remove processes owned by a particular user ID then you can “grep” that in withi the for loop.




