----- Original Message ----- From: Junix Gaspar
To: Philippine Linux Users' Group (PLUG) Technical Discussion List
Sent: Tuesday, May 15, 2007 3:17 PM
Subject: Re: [plug] memory leak

My comment was actually in support of that. I just want to tell the user that for starters, Linux do behave like that (use spare mem for cache) because he cannot believe that
Linux will actually use that much memory.

not only linux but also other unix variants and non-unix as well for performance reasons....

Additionally, I believe zombie process can also eat memory, you may want to check on it also.

nope.. zombie doesnt eat memory that was allocated before by that zombie process... zombie exist when a program forks and the child finishes before the parent... where the parent didnt wait for it (eg. wait())... the kernel still keeps some of its information about the child in case the parent might need it (eg. child exit status)... a child finishes with either of the following reasons..

1. normal termination
   a.  executing a *return* from the main function...
   b. calling the *exit* function...
   c. calling the *_exit* function

2. abnormal termination
   a. calling *abort*
   b. receives a certain *signals* (eg. kill -9 )

either the child terminates with normal or abnormal termination regardless how it was terminated... the kernel closes the open file descriptors and releases the memory that it was using and the like... the only allocated memory that was not release by the kernel is the process table entry for that child (zombie as to speak) until the parent waited for it...

fooler.


_________________________________________________
Philippine Linux Users' Group (PLUG) Mailing List
[email protected] (#PLUG @ irc.free.net.ph)
Read the Guidelines: http://linux.org.ph/lists
Searchable Archives: http://archives.free.net.ph

Reply via email to