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
|