You are here

Determine shared memory segment allocation

To determine shared memory segement allocation, use ipcs this utility is used to
report status of interprocess communication facilities. Run the following

ipcs –mob

You will see an output similar to this :

IPC status from /dev/kmem as of Tue Apr 17 09:29:33 2001
Shared Memory:
m 0 0x411c0359 --rw-rw-rw- root root 0 348
m 1 0x4e0c0002 --rw-rw-rw- root root 1 61760
m 2 0x412006c9 --rw-rw-rw- root root 1 8192
m 3 0x301c3445 --rw-rw-rw- root root 3 1048576
m 4004 0x0c6629c9 --rw-r----- root root 2 7235252
m 5 0x06347849 --rw-rw-rw- root root 1 77384
m 206 0x4918190d --rw-r--rw- root root 0 22908
m 6607 0x431c52bc --rw-rw-rw- daemon daemon 1 5767168

The two fields of the most interest are NATTCH and SEGSZ.

NATTCH -The number of processes attached to the associated shared
memory segment. Look for those that are 0, they indicate processes who have not
released their shared memory segment.

If there are multiple segments showing with an NATTACH of zero , especially if
they are owned by a database, this can be an indication that the segments are
not being efficiently released . This is due to the program not calling
detachreg. These segments can be removed using ipcrm -m shmid.

Note : Even though there is no process attached to the segment , the data
structure is still intact. The shared memory segment and data structure
associated with it are destroyed by executing this command.

Unix Systems: 

Add new comment

Filtered HTML

  • Web page addresses and e-mail addresses turn into links automatically.
  • Allowed HTML tags: <a> <em> <strong> <cite> <blockquote> <code> <ul> <ol> <li> <dl> <dt> <dd>
  • Lines and paragraphs break automatically.

Plain text

  • No HTML tags allowed.
  • Web page addresses and e-mail addresses turn into links automatically.
  • Lines and paragraphs break automatically.
By submitting this form, you accept the Mollom privacy policy.

Fatal error: Class CToolsCssCache contains 1 abstract method and must therefore be declared abstract or implement the remaining methods (DrupalCacheInterface::__construct) in /homepages/37/d228974590/htdocs/sites/all/modules/ctools/includes/ on line 52