1835079 Members
3285 Online
110073 Solutions
New Discussion

shared memory

 
Alex Lavrov
Regular Advisor

shared memory

I have the following tools:
kmeminfo
shminfo
procsize
and glance
how can i fined all the processes who are attached to a single share memory segment ??

I want it to be sorted in this order(by shared memory id).

thnx.
8 REPLIES 8
Graham Cameron_1
Honored Contributor

Re: shared memory

"ipcs -ma" will give you the info you need.
Sorting by id is a little trickier, as the first 3 lines are header info, and will mess up the sort.
Here's one way:
--
ipcs -am|awk '
(NR <= 3) {print}
(NR >3 ) {print >> "/tmp/ipcs.out"}
END { system ("sort -n -k 3,3 /tmp/ipcs.out && rm /tmp/ipcs.out") }
'
--
see man ipcs
--
Graham
Computers make it easier to do a lot of things, but most of the things they make it easier to do don't need to be done.
Alex Lavrov
Regular Advisor

Re: shared memory

I want to see all the processes who are attached to a specific shared memory region.

ipcs -ma show only the shared memory regions their id's and the pid of the creator.

i want to see in a giving time which processes are mapped to this regions

thanx.
Graham Cameron_1
Honored Contributor

Re: shared memory

Sorry, I misunderstood (or failed to read!).
ipcs -ma will give you the number of attached processes under the NATTCH col, but I know of no way to list each process.
You could write a C program to do this, using the shmctl() call.
With any luck, someone will have already done this.
Try the porting centre at http://hpux.connect.org.uk/
-- Graham
Computers make it easier to do a lot of things, but most of the things they make it easier to do don't need to be done.
Alex Lavrov
Regular Advisor

Re: shared memory

I didnt found such a utilitiy.

if some one know where i can find such a utility it will be great.

thanx.
Ravi_8
Honored Contributor

Re: shared memory

Hi,

#ipcs -ma

shows all process attached to shared memory
never give up
Alex Lavrov
Regular Advisor

Re: shared memory

ipcs -ma doesnt show the pids of all the processes that attached to a shared memory region.
T G Manikandan
Honored Contributor

Re: shared memory

#ipcs -maob

Also you can use shminfo
get it from

ftp://contrib:9unsupp8@hprc.external.hp.com/sysadmin/programs/shminfo/
Alex Lavrov
Regular Advisor

Re: shared memory

ipcs -maob is not showing me all the processes that attached to a specific region