Summary:shared memory

From: jennifer climenti <>
Date: Mon Dec 17 2001 - 08:40:39 EST
Tons of thanks guys,

accept my apologies for the late summary.

Response from alex


Well, shared memory is a System V method of interprocess
communication. It allows multiple processes to attach to the same
memory segment and allows the sharing of data.
This avoids having to perform a memory to memory copies.
Shared memory is no different than regular memory, in the sense that it
still consists of memory pages and also is managed by the page daemon.

The kernel parameters associated with shared memory are SHMMAX,
Semaphores are also the System V mechanisms of interprocess
communication. They are used to protect the resources.
As resources are allocated, the semaphore counter is decremented.
As resources are freed, the counter is incremented.
A count of zero indicates that no resources are available.


Shared memory is used to share information among different processes
(programs). If you use a lot of processes that do IPC (inter process
communication - exchanging data among themselves) ,you should increase
limits in /etc/system file. Oracle or other DB engine would be such a
program or GNOME desktop environment is another.
The ipc command in the Solaris is used to view info about different IPC


Check out Andy Tannenbaum's text "Modern Operating Systems" for starters, 
specifically the section on Inter-Process Communication (the IPC part of 
Shared memory is a block of RAM that two or more processes can access, 
usually containing data structures used by both processes.  Semaphores are 
used to control access to shared memory segments, or any other shared 
resource, such that only one process has access to a region at a time.  One 
process creates the shared memory segments and semaphores and shares the 
keys with other processes.  Each process must incorporate the semaphore and 
shared memory system calls into functions that guarantee mutually-exclusive 
access to the shared resources.  There is a third type of synchronization 
mechanism, called a message queue, which is also part of the SYSV IPC 
scheme.  The SYSV IPC architecture is used to coordinate and synchronize 
processes sharing the same physical memory.  Distributed processes, such as 
TCP/IP, use the Berkeley IPC scheme, which is implemented with sockets.
IPC is used mostly by database engines such as Oracle, to facilitate 
transaction processing.  Unless you have an application which requires 
extensive use of shared memory and semaphores, adding more to the system 
will have no positive effect.  Many applications, like Oracle, that use 
shared memory, will not run at all unless the system parameters are 
correctly set.
If you have lots of applications that use shared memory, and they need to 
run concurrently, you need to compute how many segments and semaphores are 
required by each, and set accordingly.  Since the control structures for 
shared memory and semaphores are in kernel space, having too many semaphores 
allocated increases the amount of non-swappable memory used in your system, 
so indiscriminately increasing the settings in /etc/system can actually 
decrease the performance of your system.
ipcs is what you use to determine how many shared memory segments and 
semaphores are actually in use at a given time, to aid you in determining if 
your current settings are adequate.  Since most applications dynamically 
allocate and release shared memory as required, it is most valuable in 
analyzing crash dumps.  Otherwise, all you get is a snapshot of the current 
system IPC status, which won't tell you much.  The operating system itself 
uses a certain number of IPC structures, depending on what is running, how 
many CPUs the system has, etc.


My original post :
Can any one through me some light on what exactly is shared memory and if i
set this parameter how my system performance is going to  boost ( i
heard!)..and also semaphores...please point me to any  links to get
information on this...

what does "ipcs" command used in solaris...i didn't understand the concept
clearly from man pages...

tons of thanks in advance


Chat with friends online, try MSN Messenger:
sunmanagers mailing list
Received on Mon Dec 17 07:54:15 2001

This archive was generated by hypermail 2.1.8 : Thu Mar 03 2016 - 06:42:30 EST