10 Shared memory segments in AIX

10 Shared memory segments in AIX

Post by Karl-Heinz Frankes » Fri, 24 Jan 1997 04:00:00



In aix there is a restriction to ten shared memory segments. Is this
an restriction for the whole system or is it true  for one process?
Greetings
KHF

 
 
 

10 Shared memory segments in AIX

Post by Dave Marquard » Fri, 24 Jan 1997 04:00:00



> In aix there is a restriction to ten shared memory segments. Is this
> an restriction for the whole system or is it true  for one process?

That's a per process limitation, and it's based on the POWER and
PowerPC segment architecture.  POWER/PowerPC has 16 segments, and 6 of
them are reserved for user and kernel data and code.  You can get
around the limitation by using mmap instead of shmat.

-Dave

 
 
 

10 Shared memory segments in AIX

Post by Dave Stagne » Sat, 25 Jan 1997 04:00:00



> In aix there is a restriction to ten shared memory segments. Is this
> an restriction for the whole system or is it true  for one process?
> Greetings
> KHF

This is true for a single process.  The virtual memory system divides
process memory into 16 segments.  Of these, 6 are used for various
required functions (stack, heap, text, etc), and the other 10 can be
allocated to shared memory.  

If you need more shared memory segments than that, the BSD mmap() call
can be used to generate anonymous shared memory segments.  But these
aren't as flexible as regular shared memory... they can only be shared
via parent-child relationships.  If you can work within the limitations,
however, they're very useful.  I have a process that allocates 200
anonymous mmap()'d shared memory buffers, and it is very robust.  

If you're using an old AIX 3.2.5, be careful!  There's a bug that can
lead to mmap()'d pages being erased.  If you have problems, you may need
to upgrade to a modern patchlevel.  This problem scared the heck out of
me... my program worked fine in testing, but blew up in production on
slightly different machines.  It took days to track the problem down,
and days more to convince IBM it was a legitimate bug.
--

National Computer Systems       vox 319 354 9200        
Iowa City, IA                   fax 319 339 6555        
Economics is the "dismal science".  Software is the "dismal
engineering".