Latest LQ Deal: Latest LQ Deals
Go Back > Forums > Linux Forums > Linux - Hardware
User Name
Linux - Hardware This forum is for Hardware issues.
Having trouble installing a piece of hardware? Want to know if that peripheral is compatible with Linux?


  Search this Thread
Old 10-08-2007, 08:05 AM   #1
Registered: May 2007
Posts: 63

Rep: Reputation: 15
Exclamation usage of shared memory

Hello everybody,
Good Day to all.I know to see the allowcated shared memory by using the command "ipcs".i would like to know the command to monitor the usage of shared memory that is displaying used memory and leftout memory.(note: like the command "free" to see the used and left ram memory)
Please help me.Thanks in advance.
Old 10-16-2007, 03:12 PM   #2
LQ Newbie
Registered: Aug 2004
Location: Baltimore, MD, USA
Distribution: RedHat, SuSE, Debian, Kubuntu
Posts: 1

Rep: Reputation: 0
No specific command

As far as I know, there is no specific command to display shared memory status dynamically. The thing is, a single block is allocated and because it is shared, multiple processes can attach/detach it and read/write from the same addresses. The system information does not really supply enough data to display detailed information.

What you can display is in 2 commands: ipcs and sysctl. To get the limits, enter the following as root (this info is in /proc/sys/kernel/shm*):

sysctl -a | grep shm

kernel.shmmni: The maximum number of shared memory segments
kernel.shmall: The maximum of shared memory pages
kernel.shmmax: The maximum size in bytes for a shared memory segment

To get the allocation, enter:

ipcs -m

The relevant columns are:

shmid: The value used to free the segment with ipcrm
perms: The permissions, which have the same meaning as file permisisons
bytes: The number of bytes in the allocated segment
nattch: The number of processes that have attached the segment for access

Shared memory is treated like regular memory as far as top or free are concerned. So when you see the amount of available memory, that is just the number of unused pages in RAM. In top, the amount of shared memory plus any other memory allocated by each process is shown in the VIRT column, while the amount of memory actually being used is shown in the RES column.

From this info you might get what you need, otherwise it is up to the application to supply how it is using shared memory.

Later . . . Jim


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off

Similar Threads
Thread Thread Starter Forum Replies Last Post
X hangs after prolonged usage ... memory usage goes upto 195MB duryodhan Slackware 18 05-10-2007 06:16 PM
Memory Usage Spaw Usage Swappiness Issues joelunch Linux - Software 3 01-04-2006 06:16 PM
getting realtime info on memory usage-cpu and harddrive usage steering Linux - Newbie 5 03-03-2005 08:43 PM
how to determine cpu usage, memory usage, I/O usage by a particular user logged on li rags2k Programming 4 08-21-2004 04:45 AM
Controlling CPU usage & memory usage Saravana babu Linux - Software 0 02-18-2004 05:55 AM > Forums > Linux Forums > Linux - Hardware

All times are GMT -5. The time now is 01:55 PM.

Main Menu
Write for LQ is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration