One can use the cleansharedmemory.sh
script available under the
slsDetector Package.
One can also just use the following commands to clean the shared memory segments one by one.
#displays list of shared memeory segments ipcs -m #remove segments that have nattach equal to zero. They key is the first column ipcrm -M [key]