* Q: "orphaned" shared memory segments
@ 1994-07-25 18:30 Peyton Bland
1994-07-26 0:45 ` Andy Jacobson
1994-07-26 15:57 ` David Potter
0 siblings, 2 replies; 12+ messages in thread
From: Peyton Bland @ 1994-07-25 18:30 UTC (permalink / raw)
We are running OSF/1 V1.3a on a DEC Alpha 3000 Model 500. Our main
application (avs) uses shared memory extensively. Over time, we run out of
shared memory segments. The "ipcs -mo" command shows "orphaned" segments;
ie, segments that have no process attached to them. There are other
segments that show that they are attached to processes but were created by
users that are no longer logged on. I assume these result if the
application terminates abnormally.
These can be cleaned up manually using the "ipcrm -m <nnn>" command.
Anybody else seen this? Is this a problem with OSF or with the
application? It's easy to write a short script that uses awk to do some of
this cleanup, but shouldn't this be handled a little better than this?
Thanks, Peyton
-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
Peyton Bland Digital Image Processing Lab
Dept. of Radiology University of Michigan
-----------------------------------------------------------
"We all have better moments than anybody ever knows, and so
do all the others.... We are a great mystery. Each one of
us is a secret, and on that basis we ought to treat each
other with the deepest respect."
-- Garrison Keillor
=-=-=-=-=-=-=-=-=-=-=-=-=-=-=--=-=-=-=-=-=-=-=-=-=-=-=-=-=-
^ permalink raw reply [flat|nested] 12+ messages in thread
* Re: Q: "orphaned" shared memory segments
1994-07-25 18:30 Q: "orphaned" shared memory segments Peyton Bland
@ 1994-07-26 0:45 ` Andy Jacobson
1994-07-26 14:33 ` Peyton Bland
1994-07-26 15:57 ` David Potter
1 sibling, 1 reply; 12+ messages in thread
From: Andy Jacobson @ 1994-07-26 0:45 UTC (permalink / raw)
In article <peyton.bland-250794142117@86.12.med.umich.edu> peyton.bland@med.umich.edu (Peyton Bland) writes:
>We are running OSF/1 V1.3a on a DEC Alpha 3000 Model 500. Our main
>application (avs) uses shared memory extensively. Over time, we run out of
>shared memory segments. The "ipcs -mo" command shows "orphaned" segments;
>ie, segments that have no process attached to them. There are other
>segments that show that they are attached to processes but were created by
>users that are no longer logged on. I assume these result if the
>application terminates abnormally.
>
>These can be cleaned up manually using the "ipcrm -m <nnn>" command.
>Anybody else seen this? Is this a problem with OSF or with the
>application? It's easy to write a short script that uses awk to do some of
This is an AVS thing. I use AVS on both Sun and Alpha AXP and they both
have this problem. I have confered with AVS about it, and they explain that
this is what happens anytime you exit AVS not through the main menu.
I suppose that AVS has a destruct function that cleans these all out, otherwise
there is nothing to delete them when AVS processes die.
It would be nice if there were a utility (aside from reboot) that would clean
out shmsegs that are not attached, but, not knowing of any, I use ipcrm -m
for all the segs. (Quite a bother). One thing that I wonder about is why
is /usr/bin/X11/X creating these shmsegs too? These appear to just pile up
and are perhaps just fragmenting the available memory? On SunOS, there does
not appear to be anything systemwise that creates these, why so on the DEC?
--
Andy Jacobson <afj@DrMemory.nuc.ucla.edu> <afj@chem.ucla.edu>
^ permalink raw reply [flat|nested] 12+ messages in thread
* Re: Q: "orphaned" shared memory segments
1994-07-26 0:45 ` Andy Jacobson
@ 1994-07-26 14:33 ` Peyton Bland
0 siblings, 0 replies; 12+ messages in thread
From: Peyton Bland @ 1994-07-26 14:33 UTC (permalink / raw)
In article <311maf$398@news.mic.ucla.edu>, afj@DrMemory.nuc.ucla.edu (Andy
Jacobson) wrote:
>
> In article <peyton.bland-250794142117@86.12.med.umich.edu> peyton.bland@med.umich.edu (Peyton Bland) writes:
> >We are running OSF/1 V1.3a on a DEC Alpha 3000 Model 500. Our main
> >application (avs) uses shared memory extensively. Over time, we run out of
> >shared memory segments. The "ipcs -mo" command shows "orphaned" segments;
> >ie, segments that have no process attached to them. There are other
> >segments that show that they are attached to processes but were created by
> >users that are no longer logged on. I assume these result if the
> >application terminates abnormally.
> >
> >These can be cleaned up manually using the "ipcrm -m <nnn>" command.
> >Anybody else seen this? Is this a problem with OSF or with the
> >application? It's easy to write a short script that uses awk to do some of
>
> This is an AVS thing. I use AVS on both Sun and Alpha AXP and they both
> have this problem. I have confered with AVS about it, and they explain that
> this is what happens anytime you exit AVS not through the main menu.
> I suppose that AVS has a destruct function that cleans these all out, otherwise
> there is nothing to delete them when AVS processes die.
> It would be nice if there were a utility (aside from reboot) that would clean
> out shmsegs that are not attached, but, not knowing of any, I use ipcrm -m
> for all the segs. (Quite a bother).
Andy,
Thanks for the info. I did a little playing around and found that under
some circumstances of exiting AVS "abnormally", segs are deleted. Anyway,
here is a little procedure I worked out on our Alpha to remove segments
that have no processes attached. It's not guaranteed for all systems, it's
not elegant, and it doesn't cleanup all the segments that I would like it
to, but it's a start...
ipcs -mo | tail +4 | awk '{if ($7 == 0) print $2}' | xargs -t -i ipcrm -m
{}
(There are several segments on our system now that show processes attached
to them, but no users or active PIDs associated with them, so a neat
enhancement would be to match-up active PIDs with the PIDs from the ipcs
command and process accordingly. Any takers?) I guess it could be run by
cron periodically. We don't re-boot too often, so this procedure should
help. At one point we had about 30-40 orphaned segments and were running
out of shared memory even though half of our 256Mbytes of main memory are
setup for shared memory, so it's a real problem!
Peyton
-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
Peyton Bland Digital Image Processing Lab
Dept. of Radiology University of Michigan
-----------------------------------------------------------
"We all have better moments than anybody ever knows, and so
do all the others.... We are a great mystery. Each one of
us is a secret, and on that basis we ought to treat each
other with the deepest respect."
-- Garrison Keillor
=-=-=-=-=-=-=-=-=-=-=-=-=-=-=--=-=-=-=-=-=-=-=-=-=-=-=-=-=-
^ permalink raw reply [flat|nested] 12+ messages in thread
* Re: Q: "orphaned" shared memory segments
1994-07-25 18:30 Q: "orphaned" shared memory segments Peyton Bland
1994-07-26 0:45 ` Andy Jacobson
@ 1994-07-26 15:57 ` David Potter
1994-07-26 16:43 ` Steve Peltz
1 sibling, 1 reply; 12+ messages in thread
From: David Potter @ 1994-07-26 15:57 UTC (permalink / raw)
In article <peyton.bland-250794142117@86.12.med.umich.edu>,
Peyton Bland <peyton.bland@med.umich.edu> wrote:
>We are running OSF/1 V1.3a on a DEC Alpha 3000 Model 500. Our main
>application (avs) uses shared memory extensively. Over time, we run out of
>shared memory segments. The "ipcs -mo" command shows "orphaned" segments;
>ie, segments that have no process attached to them. There are other
>segments that show that they are attached to processes but were created by
>users that are no longer logged on. I assume these result if the
>application terminates abnormally.
>
>These can be cleaned up manually using the "ipcrm -m <nnn>" command.
>Anybody else seen this? Is this a problem with OSF or with the
>application? It's easy to write a short script that uses awk to do some of
>this cleanup, but shouldn't this be handled a little better than this?
>
>Thanks, Peyton
>
>-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
>Peyton Bland Digital Image Processing Lab
>Dept. of Radiology University of Michigan
>-----------------------------------------------------------
>"We all have better moments than anybody ever knows, and so
>do all the others.... We are a great mystery. Each one of
>us is a secret, and on that basis we ought to treat each
>other with the deepest respect."
> -- Garrison Keillor
>=-=-=-=-=-=-=-=-=-=-=-=-=-=-=--=-=-=-=-=-=-=-=-=-=-=-=-=-=-
This is quite normal for shared memory. Even programs that
end normally leave their shared memory around, unless they explicitly
remove it. I have a problem that the shared memory detach and remove
fail sometimes. I do not know why (This occurs on an SCO Unix system.)
--
David Potter, Open System Performance, Inc., (916)987-7531
potter@osperf.com
^ permalink raw reply [flat|nested] 12+ messages in thread
* Re: Q: "orphaned" shared memory segments
1994-07-26 15:57 ` David Potter
@ 1994-07-26 16:43 ` Steve Peltz
1994-07-26 22:02 ` Peter da Silva
0 siblings, 1 reply; 12+ messages in thread
From: Steve Peltz @ 1994-07-26 16:43 UTC (permalink / raw)
In article <potterCtK1o8.98F@netcom.com>,
David Potter <potter@netcom.com> wrote:
>This is quite normal for shared memory. Even programs that
>end normally leave their shared memory around, unless they explicitly
>remove it.
More than normal; it is required behavior. A program can detach, then
re-attach, and expect to find data still there.
I don't think that segments that are not currently mapped into a process
are actually locked into physical memory, even if they aren't deleted.
As far as I can tell, they only take up swap space (is there a separate
swap area for shared memory segments?).
Also, it looks to me as if you can delete a segment even while it is
in use, and not cause any problems for those processes that already have
it attached. In fact, I don't see any real difference between using
shared memory segments and doing mmap()/mlock() (except that mlock()
is privileged, and you can keep segments persistent over a reboot, and
you have more flexibility as to naming a segment - the whole UNIX file
system name space).
^ permalink raw reply [flat|nested] 12+ messages in thread
* Re: Q: "orphaned" shared memory segments
1994-07-26 16:43 ` Steve Peltz
@ 1994-07-26 22:02 ` Peter da Silva
1994-07-28 0:39 ` Steve Peltz
0 siblings, 1 reply; 12+ messages in thread
From: Peter da Silva @ 1994-07-26 22:02 UTC (permalink / raw)
In article <313ef7$dtg@vixen.cso.uiuc.edu>,
Steve Peltz <peltz@cerl.uiuc.edu> wrote:
> More than normal; it is required behavior. A program can detach, then
> re-attach, and expect to find data still there.
But it defeats resource tracking. If you need to keep a segment in core
you can keep a dummy process around to hold it's hand. In the more common
case you *want* segments to go away when you're done with them.
It's not just more limited than mmap(), it's not in keeping with the UNIX
design philosophy.
--
Peter da Silva `-_-'
Network Management Technology Incorporated 'U`
1601 Industrial Blvd. Sugar Land, TX 77478 USA
+1 713 274 5180 "Hast Du heute schon Deinen Wolf umarmt?"
^ permalink raw reply [flat|nested] 12+ messages in thread
* Re: Q: "orphaned" shared memory segments
1994-07-26 22:02 ` Peter da Silva
@ 1994-07-28 0:39 ` Steve Peltz
1994-07-28 14:42 ` Peter da Silva
0 siblings, 1 reply; 12+ messages in thread
From: Steve Peltz @ 1994-07-28 0:39 UTC (permalink / raw)
I'm certainly not defending shmget/etc design philosophy, I think it
stinks. However, as defined, a shared segment must not go away simply
because no process has it attached or mapped.
^ permalink raw reply [flat|nested] 12+ messages in thread
* Re: Q: "orphaned" shared memory segments
1994-07-28 0:39 ` Steve Peltz
@ 1994-07-28 14:42 ` Peter da Silva
1994-07-28 20:06 ` Steve Peltz
1994-07-29 8:58 ` Burkhard Neidecker-Lutz
0 siblings, 2 replies; 12+ messages in thread
From: Peter da Silva @ 1994-07-28 14:42 UTC (permalink / raw)
In article <316unu$15h@vixen.cso.uiuc.edu>,
Steve Peltz <peltz@cerl.uiuc.edu> wrote:
> However, as defined, a shared segment must not go away simply
> because no process has it attached or mapped.
By whose definition? Seriously... what's the requirement for persistent
shared memory that isn't better served by mapped files?
--
Peter da Silva `-_-'
Network Management Technology Incorporated 'U`
1601 Industrial Blvd. Sugar Land, TX 77478 USA
+1 713 274 5180 "Hast Du heute schon Deinen Wolf umarmt?"
^ permalink raw reply [flat|nested] 12+ messages in thread
* Re: Q: "orphaned" shared memory segments
1994-07-28 14:42 ` Peter da Silva
@ 1994-07-28 20:06 ` Steve Peltz
1994-07-29 15:24 ` Peter da Silva
1994-07-29 8:58 ` Burkhard Neidecker-Lutz
1 sibling, 1 reply; 12+ messages in thread
From: Steve Peltz @ 1994-07-28 20:06 UTC (permalink / raw)
In article <id.SKMB1.XRG@nmti.com>, Peter da Silva <peter@nmti.com> wrote:
> Seriously... what's the requirement for persistent
>shared memory that isn't better served by mapped files?
Primary reason I'd guess is compatibility to programs that were developed
using shmget instead of mmap.
My reason is that I can't mlock my segments and mmap randomly pages in the
wrong page occasionally. As soon as the machine's owner gets back and
installs mlock and gives me root privileges, and/or installs the rumored
patch that fixes the mmap bug, I'll stop using shared memory.
^ permalink raw reply [flat|nested] 12+ messages in thread
* Re: Q: "orphaned" shared memory segments
1994-07-28 14:42 ` Peter da Silva
1994-07-28 20:06 ` Steve Peltz
@ 1994-07-29 8:58 ` Burkhard Neidecker-Lutz
1994-07-29 15:26 ` Peter da Silva
1 sibling, 1 reply; 12+ messages in thread
From: Burkhard Neidecker-Lutz @ 1994-07-29 8:58 UTC (permalink / raw)
In article <id.SKMB1.XRG@nmti.com> peter@nmti.com (Peter da Silva) writes:
>> However, as defined, a shared segment must not go away simply
>> because no process has it attached or mapped.
>
>By whose definition? Seriously... what's the requirement for persistent
>shared memory that isn't better served by mapped files?
SVID, i.e. AT&T at that time. Of course, newer code should use mmap.
Burkhard Neidecker-Lutz
GLASS Project, CEC Karlsruhe
Advanced Technology Group, Digital Equipment Corporation
neideck@nestvx.enet.dec.com
^ permalink raw reply [flat|nested] 12+ messages in thread
* Re: Q: "orphaned" shared memory segments
1994-07-28 20:06 ` Steve Peltz
@ 1994-07-29 15:24 ` Peter da Silva
0 siblings, 0 replies; 12+ messages in thread
From: Peter da Silva @ 1994-07-29 15:24 UTC (permalink / raw)
In article <31934f$jut@vixen.cso.uiuc.edu>,
Steve Peltz <peltz@cerl.uiuc.edu> wrote:
> My reason is that I can't mlock my segments and mmap randomly pages in the
> wrong page occasionally.
Oh, ick. OK, you're using 'em as a workaround for a bug. I'm more looking
at it from the perspective of what the user interface semantics should be.
--
Peter da Silva `-_-'
Network Management Technology Incorporated 'U`
1601 Industrial Blvd. Sugar Land, TX 77478 USA
+1 713 274 5180 "Hast Du heute schon Deinen Wolf umarmt?"
^ permalink raw reply [flat|nested] 12+ messages in thread
* Re: Q: "orphaned" shared memory segments
1994-07-29 8:58 ` Burkhard Neidecker-Lutz
@ 1994-07-29 15:26 ` Peter da Silva
0 siblings, 0 replies; 12+ messages in thread
From: Peter da Silva @ 1994-07-29 15:26 UTC (permalink / raw)
In article <31agavINNgs2@usenet.pa.dec.com>,
Burkhard Neidecker-Lutz <neideck@nestvx.enet.dec.com> wrote:
> In article <id.SKMB1.XRG@nmti.com> peter@nmti.com (Peter da Silva) writes:
> >> However, as defined, a shared segment must not go away simply
> >> because no process has it attached or mapped.
> >By whose definition? Seriously... what's the requirement for persistent
> >shared memory that isn't better served by mapped files?
> SVID, i.e. AT&T at that time.
Ah, a circular definition.
--
Peter da Silva `-_-'
Network Management Technology Incorporated 'U`
1601 Industrial Blvd. Sugar Land, TX 77478 USA
+1 713 274 5180 "Hast Du heute schon Deinen Wolf umarmt?"
^ permalink raw reply [flat|nested] 12+ messages in thread
end of thread, other threads:[~1994-07-29 15:26 UTC | newest]
Thread overview: 12+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
1994-07-25 18:30 Q: "orphaned" shared memory segments Peyton Bland
1994-07-26 0:45 ` Andy Jacobson
1994-07-26 14:33 ` Peyton Bland
1994-07-26 15:57 ` David Potter
1994-07-26 16:43 ` Steve Peltz
1994-07-26 22:02 ` Peter da Silva
1994-07-28 0:39 ` Steve Peltz
1994-07-28 14:42 ` Peter da Silva
1994-07-28 20:06 ` Steve Peltz
1994-07-29 15:24 ` Peter da Silva
1994-07-29 8:58 ` Burkhard Neidecker-Lutz
1994-07-29 15:26 ` Peter da Silva
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox