Sorry to ask such a silly question as i am noob in unix. what are the unix commands to find shared memory and message queue and how to kill them ?
There are two ways: Use the Unix command ipcs to get a list of defined message queues, then use the command ipcrm to delete the queue.
# ipcs -a : It provides details about message queue, semaphore and shared memory. All the IPC facility has unique key and identifier, which is used to identify an IPC facility.
The ipcs command writes to the standard output information about active interprocess communication facilities. If you do not specify any flags, the ipcs command writes information in a short form about currently active message queues, shared memory segments, semaphores, remote queues, and local queue headers.
ipcs(1)
provides information on the IPC facilities and ipcrm(1)
can be used to remove the IPC objects from the system.
List shared memory segments:
ipcs -m
List message queues:
ipcs -q
Remove shared memory segment created with shmkey
:
ipcrm -M key
Remove shared memory segment identified by shmid
:
ipcrm -m id
Remove message queue created with msgkey
:
ipcrm -Q key
Remove message queue identified by msgid
:
ipcrm -q id
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With