Operating System - HP-UX
1834254 Members
4129 Online
110066 Solutions
New Discussion

shared memory segments cannot be removed?

 
SOLVED
Go to solution
-error
Occasional Contributor

shared memory segments cannot be removed?

hi
one of our server is suffering from inability to remove unowned shared memory segments.
for example:
[... cut ...]
sergey@storm:~$ ipcs -ompb | egrep "ID|0x00000000"
T ID KEY MODE OWNER GROUP NATTCH SEGSZ CPID LPID
m 59375632 0x00000000 D-rw-r----- oracle dba 9 33554432 15139 15740
m 65556 0x00000000 D-rw-r----- oracle dba 6 1112498176 21021 21021
m 196631 0x00000000 D-rw-r----- oracle dba 9 402653184 15139 15740
m 327704 0x00000000 D-rw-r----- oracle dba 9 33554432 15139 15740
m 1467154462 0x00000000 D-rw-r----- oracle dba 9 33554432 15139 15740
m 760610847 0x00000000 D-rw-r----- oracle dba 9 33554432 15139 15740
m 129859616 0x00000000 D-rw-r----- oracle dba 9 33554432 15139 15740
m 1469677601 0x00000000 D-rw-r----- oracle dba 9 33554432 15139 15740
m 1474594 0x00000000 D-rw-r----- oracle dba 9 33554432 15139 15740
m 109183011 0x00000000 D-rw-r----- oracle dba 9 33554432 15139 15740
m 163876 0x00000000 D-rw-r----- oracle dba 9 134217728 15139 15740
m 163877 0x00000000 D-rw-r----- oracle dba 9 83886080 15139 15740
sergey@storm:~$ sudo ipcrm -m 59375632
Password:
ipcrm: shmid(59375632): not found
[... cut ...]
there is no processes with PIDs listed above in system:
[... cut ...]
sergey@storm:~$ ps -ef | egrep "15139|15740|21021" | grep -v grep
sergey@storm:~$
[... cut ...]
but nevertheless ipcs showing non-zero NATTACH.
what can be prblem with? m.b. there is some patch or something else?
8 REPLIES 8
Ivan Krastev
Honored Contributor

Re: shared memory segments cannot be removed?

What is your OS version ?

For 11.11 there is a patch PHKL_27686 (replaced by PHKL_30992) which fix the problem.


regards,
ivan
-error
Occasional Contributor

Re: shared memory segments cannot be removed?

ouch. my fault.
HP-UX is 11.23 on ia64 platform.
Ivan Krastev
Honored Contributor

Re: shared memory segments cannot be removed?

Actually the memory segment is removed - see D flag. It will disappear
when the last process attached to the segment detaches it.


regards,
ivan
Ivan Krastev
Honored Contributor
Solution

Re: shared memory segments cannot be removed?

And forgot this one - check which process is using segment(s) with shminfo. This is unsupported tool - ftp://contrib:9unsupp8@hprc.external.hp.com/sysadmin/programs/


regards,
ivan
-error
Occasional Contributor

Re: shared memory segments cannot be removed?

you mean thats just a record about shared segment and it does not consume memory?
Ivan Krastev
Honored Contributor

Re: shared memory segments cannot be removed?

See man page for ipcs :

D The associated shared memory segment has been
removed. It will disappear when the last
process attached to the segment detaches it.

In this case memory is not used.

regards,
ivan
-error
Occasional Contributor

Re: shared memory segments cannot be removed?

>In this case memory is not used.
i guess you're not quite right here. memory usage dropped to 50% after killing all discovered processes (according to swapinfo). it was about 80% before.

thanks anyway.
Dennis Handly
Acclaimed Contributor

Re: shared memory segments cannot be removed?

>i guess you're not quite right here. memory usage dropped to 50% after killing

That's right. D just means that one process has removed the shared memory but all of the NATTACH processes are still using it. (It's like removing a file, the space isn't removed until the last process closes it.)

If you use ipcs -ma, you'll get DTIME of when a shmdt(2) was done. This maybe close in time to when it was removed.

If you look at this thread, you'll see my program to give the time in terms of date and time to see how long the segment has been in limbo:
http://forums1.itrc.hp.com/service/forums/questionanswer.do?threadId=1136341

Also, here is a link that matches your question:
http://forums1.itrc.hp.com/service/forums/questionanswer.do?threadId=611062