Subject: Re: SysV SHM never removed
To: Thilo Manske <Thilo.Manske@HEH.Uni-Oldenburg.DE>
From: Jason Thorpe <thorpej@nas.nasa.gov>
List: current-users
Date: 02/12/2000 09:30:21
On Sat, 12 Feb 2000 17:23:35 +0100
Thilo Manske <Thilo.Manske@HEH.Uni-Oldenburg.DE> wrote:
> > shmget: Cannot allocate memory
> >
> > The only way to clear this is to reboot.
> Workaround (instead of reboot):
>
> You can try ipcs(1) & ipcrm(1) to manually remove shared memory segments,
> e.g.
> ipcs -m|grep ^m|awk '{ print $2 }'|xargs -n 1 ipcrm -m
Right.
Note, the semantics of SYSV IPC are that shared memory segments are NOT
removed when the process exists! It's kind of like an in-memory shared
segment file system, of sorts.
Programs which create SHM segments *must* tear them down themselves!
I'm pretty sure this is documented in X/Open, and if I have time today,
I'll take a look.
-- Jason R. Thorpe <thorpej@nas.nasa.gov>