From mboxrd@z Thu Jan 1 00:00:00 1970 X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: fee84,3a6754711ac14f3e X-Google-Attributes: gidfee84,public X-Google-ArrivalTime: 1994-07-26 07:42:09 PST Path: nntp.gmd.de!Germany.EU.net!EU.net!howland.reston.ans.net!europa.eng.gtefsd.com!newsxfer.itd.umich.edu!news.itd.umich.edu!86.12.med.umich.edu!user From: peyton.bland@med.umich.edu (Peyton Bland) Newsgroups: comp.unix.osf.osf1 Subject: Re: Q: "orphaned" shared memory segments Followup-To: comp.unix.osf.osf1 Date: 26 Jul 1994 14:33:14 GMT Organization: Univ. of Mich., Dept. of Radiology Distribution: world Message-ID: References: <311maf$398@news.mic.ucla.edu> NNTP-Posting-Host: 86.12.med.umich.edu In article <311maf$398@news.mic.ucla.edu>, afj@DrMemory.nuc.ucla.edu (Andy Jacobson) wrote: > > In article 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 " 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 =-=-=-=-=-=-=-=-=-=-=-=-=-=-=--=-=-=-=-=-=-=-=-=-=-=-=-=-=-