Operating System - HP-UX
1752808 Members
5904 Online
108789 Solutions
New Discussion юеВ

Re: memory reclamation and kill -9

 
SOLVED
Go to solution
Ed Loehr
Advisor

memory reclamation and kill -9

When a program is killed with SIGKILL, is the non-shared memory used by that process always immediately reclaimed by the kernel? If not, what determines whether or not such memory is reclaimed by the kernel?

Thanks.

Ed
4 REPLIES 4
Alex Lavrov.
Honored Contributor
Solution

Re: memory reclamation and kill -9

The non shared memory is reclaimed, but be aware of zombies. If the process becomes zombie for some reason (bad programming or crash of the father process for example), then the memory is not reclaimed as long as zombie process exists.

In the case all goes smooth and you don't see the PID in the "ps -ef" anymore, you can be pretty sure the the non-shared memory was released.
I don't give a damn for a man that can only spell a word one way. (M. Twain)
lawrenzo
Trusted Contributor

Re: memory reclamation and kill -9

If you need to find out any zombie processthe command # top will sow this.

see

# man top

HTH
hello
Alex Lavrov.
Honored Contributor

Re: memory reclamation and kill -9

Another way to find them (zombies):

ps -ef | grep defunct

they will show up as processes.
I don't give a damn for a man that can only spell a word one way. (M. Twain)
Steven E. Protter
Exalted Contributor

Re: memory reclamation and kill -9

One sure way to get rid of zombies.

Reboot.

kill -9 rarely works.

kill -9 can create zombies if you direct it at say the middle generation of a process that has a parent and a child.

As far as shared memory goes ipcrm -m or -s depending on the type you want released will sometimes help.

SEP
Steven E Protter
Owner of ISN Corporation
http://isnamerica.com
http://hpuxconsulting.com
Sponsor: http://hpux.ws
Twitter: http://twitter.com/hpuxlinux
Founder http://newdatacloud.com