ipcs -- report interprocess communication facilities status:
system shared memory, message queues and semaphores

ipcrm

 ipcs [-abcMmopQqSsTt]

 ipcs -asmq -tclup          ipcs [-s -m -q] -i id        ipcs -h for help.

The ipcs utility provides information on interprocess communication (IPC) facilities on the system.

Available   active
-M shared memory. -m
-Q messages queues. -q
-S semaphores. -s
-T Total (all) objects -o outstanding usage
-p process ID information for active objects. i.e.
  • is the last process to send a message to or receive a message from a message queue,
  • the process that created a semaphore, or
  • the last process to attach or detach a shared memory segment.
-c creator's name and group for active objects
-t times
    of the last control operation on an IPC object,
  • the last send or receive of a message,
  • the last attach or detach of a shared memory segment, or
  • the last operation on a semaphore.
-b maximums
the maximum number of bytes in a message on a message queue,
the size of a shared memory segment (in bytes)
the number of semaphores in a set of semaphores.
-a all information.
If none of the object options are specified, information about all active IPC facilities is listed.

RESTRICTIONS

System data structures may change while ipcs is running; the output of ipcs is not guaranteed to be consistent. SEE ALSO ipcrm
 

usage : ipcs -asmq -tclup 
        ipcs [-s -m -q] -i id
        ipcs -h for help.

> ipcs -a IPC status from as of Thu Nov 5 15:04:43 EST 2009 T ID KEY MODE OWNER GROUP CREATOR CGROUP CBYTES QNUM QBYTES LSPID LRPID STIME RTIME CTIME Message Queues: T ID KEY MODE OWNER GROUP CREATOR CGROUP NATTCH SEGSZ CPID LPID ATIME DTIME CTIME Shared Memory: m 65536 0x07021999 --rw-r--r-- root wheel root wheel 4 1460 191 343 17:37:03 15:02:36 17:34:06 m 65537 0x60022006 --rw-r--r-- root wheel root wheel 4 52 191 343 17:37:03 15:02:36 17:34:06 T ID KEY MODE OWNER GROUP CREATOR CGROUP NSEMS OTIME CTIME Semaphores:

> ipcs -M IPC status from <running system> as of Thu Nov 5 15:05:29 EST 2009 shminfo: shmmax: 4194304 (max shared memory segment size) shmmin: 1 (min shared memory segment size) shmmni: 32 (max number of shared memory identifiers) shmseg: 8 (max shared memory segments per process) shmall: 1024 (max amount of shared memory in pages) > ipcs -m ------ Shared Memory Segments -------- key shmid owner perms bytes nattch status 0x00000000 0 root 644 40 2 0x00000000 32769 root 644 16384 2 0x00000000 65538 root 644 268 2
> ipcs -q ------ Message Queues -------- key msqid owner perms used-bytes messages
> ipcs -s ------ Semaphore Arrays -------- key semid owner perms nsems

> ipcs -t ------ Shared Memory Attach/Detach/Change Times -------- shmid owner attached detached changed 0 root Sep 4 01:46:08 Sep 4 01:46:08 Sep 4 01:46:08 32769 root Sep 4 01:46:08 Sep 4 01:46:08 Sep 4 01:46:08 65538 root Sep 4 01:46:08 Sep 4 01:46:08 Sep 4 01:46:08 ------ Semaphore Operation/Change Times -------- semid owner last-op last-changed ------ Message Queues Send/Recv/Change Times -------- msqid owner send recv change
> ipcs -c ------ Shared Memory Segment Creators/Owners -------- shmid perms cuid cgid uid gid 0 644 root root root root 32769 644 root root root root 65538 644 root root root root ------ Semaphore Arrays Creators/Owners -------- semid perms cuid cgid uid gid ------ Message Queues: Creators/Owners -------- msqid perms cuid cgid uid gid
 > ipcs -usage
------ Shared Memory Status --------
segments allocated 4
pages allocated 16390
pages resident  8
pages swapped   0
Swap performance: 0 attempts 0 successes

------ Semaphore Status --------
used arrays = 5
allocated semaphores = 5




------ Messages: Status --------
allocated queues = 0
used headers = 0
used space = 0 bytes
 > ipcs -l 
------ Shared Memory Limits --------
max number of segments = 4096
max seg size (kbytes) = 4194303
max total shared memory (kb) = 1073741824
min seg size (bytes) = 1


------ Semaphore Limits --------
max number of arrays = 128
max semaphores per array = 250
max semaphores system wide = 32000
max ops per semop call = 32
semaphore max value = 32767

------ Messages: Limits --------
max queues system wide = 16
max size of message (bytes) = 65536
default max size of queue (bytes) = 65536

ipcrm - remove a message queue, semaphore set, or shared memory segment identifier

ipcrm [ -q msgid | -Q msgkey | -s semid | -S semkey | -m shmid | -M shmkey ] ...

-q msgID
-Q msgKey
Remove the message queue its data.
-S semkey
-d semid
Remove semaphore and its data.
-m shmid
-M shmkey
Remove the shared memory identifier
The shared memory segment and its data are destroyed after the last detach.