Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

command to check status of message queue and shared memory in linux?

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 ?

like image 739
zishan Avatar asked Sep 13 '13 12:09

zishan


People also ask

How do I see message queue in Linux?

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.

Which command is used to know the status of a message queue in IPC?

# 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.

What is the use of ipcs command?

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.


1 Answers

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
like image 72
HAL Avatar answered Oct 13 '22 11:10

HAL