SUMMARY: No more shared memory identifiers

Boyko, Steve (SBoyko@nbpower.com)
Tue, 03 Jun 1997 10:32:02 -0300

Wow, what a quick response!

The universal answer was use ipcs -m to list the shared memory IDs
allocated, and ipcrm -m to remove them. The man pages were
straightforward.

Also, in order to increase the number of allowed IDs, one needs to edit
/etc/system and reboot. Peter Tashkoff provided some info on what to
do; here are the related parameters as he passed them to me:

>shminfo_shmmax 131072 Maximum shared memory segment size
>shminfo_shmmin 1 Minimum shared memory segment size
>shminfo_shmmni 100 Number of shared memory identifiers
>shminfo_shmseg 6 Segments, per process
>In /etc/system,
>set shmsys:shminfo_variable=value
>reboot the system.

It turns out that around 90 to 95 of the default 100 are in use, mostly
from third-party software. I see that I'll be increasing the maximums.
:)

Kevin Sheehan said:
>I would also recommend that you investigate mmap() for this application
>if you have source. No limits, and the memory is pageable...

Unfortunately, I am allocating this shared memory to pass to a
third-party routine, so that's not a usable alternative for me. Oscar
Goldes recommended merging many IDs into one big shared memory area,
which I can't do for the same reason.

Thanks to: Frank Pardo, David Willard, John Stoffel, Kevin Sheehan,
Michael Maciolek, Oscar Goldes, and Peter Tashkoff!

My original message:
>Apologies if this is not the right list for this..
>A custom program I've written uses shmget() to allocate shared memory. It's
not
>working anymore, returning ENOSPC, which according to the man page on shmget
is:
>
> ENOSPC A shared memory identifier is to be created
> but the system-imposed limit on the maximum
> number of allowed shared memory identifiers
> system wide would be exceeded.
>
>How can I free up the shared memory IDs already allocated? Or increase the #
of
>allowable ones? I'd prefer not to reboot.

Steve Boyko
NB Power