From mboxrd@z Thu Jan 1 00:00:00 1970 X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: 1164f8,fca8d6c2f566b345,start X-Google-Attributes: gid1164f8,public X-Google-ArrivalTime: 2002-04-04 18:09:30 PST Path: archiver1.google.com!news1.google.com!newsfeed.stanford.edu!logbridge.uoregon.edu!newsfeed.dacom.co.kr!intgwlon.nntp.telstra.net!news.telstra.net!nsw.nnrp.telstra.net!pc1762.alcatel.com.au!aald03!lia From: Andrew Li Newsgroups: comp.sys.dec Subject: Which process associates with which memory segments? Organization: Alcatel Australia Limited Distribution: inet Message-ID: Mime-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII X-X-Sender: Date: Fri, 5 Apr 2002 11:16:14 +1000 NNTP-Posting-Host: 203.62.196.26 X-Complaints-To: abuse@telstra.net X-Trace: nsw.nnrp.telstra.net 1017972566 203.62.196.26 (Fri, 05 Apr 2002 12:09:26 EST) NNTP-Posting-Date: Fri, 05 Apr 2002 12:09:26 EST Xref: archiver1.google.com comp.sys.dec:12537 Is there a way to tell which process is attached to a certain shared memory segment? If I do a "ipcs -bocpm", I'll get something like this (some information is cut out to save space): ID KEY OWNER GROUP CREATOR CGROUP NATTCH SEGSZ CPID LPID 13 0x4044ed3 oracle dba oracle dba 9 784 3363 24224 How do I know what processes are using this segment? I've a tool developed locally that goes through the pid table and find as much information as possible. This tool takes a process id as argument and will report a key_t key (struct ipc_perm) of a segment. # /tmp/procmem 3371 Proc (3371): pid_entry@0xfffffc00009cbc08 Entry Start address type VSZ ObjSz resident swapped share Key 0: 0x0000000000010000 device 56K aio? 1: *0x00000000007fe000 SysVSHM 8K 1K 8K 0K 10 0x4044ed3 2: 0x0000000000800000 SSM 57344K 52416K 10208K 2176K 10 3: *0x000000011ffe0000 anon 128K 16K 0K 1 4: 0x0000000120000000 segment 8192K 8192K 5152K 95 5: 0x0000000120800000 segment 8192K 2424K 1352K 95 6: *0x0000000140000000 anon 424K 56K 0K 1 7: 0x000000014006a000 anon 472K 176K 0K 1 This is as far as I got. But this means I have to run this tool on every process on the system to compare the key, in order to find out which process is using which memory segment. Has anyone done anything like this before or could suggest a better solution? Andrew