Operating System - HP-UX
1834809 Members
2666 Online
110070 Solutions
New Discussion

Re: Shared memory - HP-UX 11.11

 
titi avan
New Member

Shared memory - HP-UX 11.11

Dear all,

While trying to launch an application that is supposed to create a shared memory segment in which to load two files (actually 3 files, as one is loaded twice) - total size approx 1.5 GB, there is the error message:

SHMGET error: not enough space.

It's not kernel parameters issue as this was checked. Any other suggestions?
4 REPLIES 4
Patrick Wallek
Honored Contributor

Re: Shared memory - HP-UX 11.11

Is this a 32-bit or 64-bit application? That will make a BIG difference regarding how it can use shared memory.

Steven E. Protter
Exalted Contributor

Re: Shared memory - HP-UX 11.11

Shalom,

You may wish to increase shmmax parameter.

You can safely increase it to 25% of system memory. That is defined as RAM plus swap.

SEP
Steven E Protter
Owner of ISN Corporation
http://isnamerica.com
http://hpuxconsulting.com
Sponsor: http://hpux.ws
Twitter: http://twitter.com/hpuxlinux
Founder http://newdatacloud.com
Bill Hassell
Honored Contributor

Re: Shared memory - HP-UX 11.11

As mentioned, there are several limits, especially for 32bit programs. If your program is only 32bits, it can't get more than about 900 megs of shared memory. If you recompile it for SHARED_MAGIC, you can get as much as 1700 megs. Now those are 32bit limits.

The kernel imposes limits on shared memory segments too. SHMMAX is the largest segment a program can request. However, 32bit orograms all share a fixed memory map for all shared resources (shared memory, semaphores, etc) so programs that were improperly terminated (ie, kill -9) will leave unuseable holes. So a large segment may be OK for SHARED_MAGIC, OK for the kernel parameter SHMMAX but fail because there is no contiguous space for the segment.

Start with the ipcs command (ipcs -bmop) to see what is currently assigned in shared memory. If the total is quite small, try rebooting so the map is clean.

Otherwise, recompile the program as 64bits. Then all practical limits disappear.


Bill Hassell, sysadmin
Ninad_1
Honored Contributor

Re: Shared memory - HP-UX 11.11

Hi ,
Basically there are 3 kernel parameters for the shared memory segments
shmmax - - maximum size (in bytes) for a System V shared memory segment
shmmni - number of System V shared memory segment identifiers in the system
NAME
shmseg - maximum number of System V shared memory segments per process
which control the behaviour of the shared memory.
Thus if a process requests for shared memory it can have a maximum of shmmax * shmseg bytes of shared memory
and the system can have a total of
shmmax * shmmni bytes of shared memory which can be allocated. Ofcourse this limit is often far too high than your system memory.

Regards,
Ninad