Rebooting after an upgrade? - Was: update-manager --no-focus-on-map ??

Paul Smith paul at mad-scientist.net
Sat Jan 2 15:18:40 UTC 2016


On Sat, 2016-01-02 at 14:23 +0000, Tony Arnold wrote:
> > Sometimes apps don't free memory, but they could do this even if you
> > exited or killed them without an upgrade, this isn't related to
> > upgrades, IOW you could recommend to restart the machine each time you
> > close an app, especially if an app didn't work correctly.
> 
> I've only seen this with zombie processes, which can only be removed
> completely by rebooting.

There's no way for a process to not free memory when it dies.  The
kernel is responsible for freeing all resources when a process exits and
there is no way to keep it from doing so.  There is only one very
specific type of inter-process shared memory which is not freed when a
process exits and this is rarely used.

Zombie processes also have already had all their memory and almost all
other resources (network connections, etc.) freed when they became
zombies.  The only resource they keep is an entry in the process table
(PID) and information on how they exited (exit code etc.)  So they do
not consume memory etc.: they are very light-weight.

Also, it's not the case that the only way to remove zombies is
rebooting.  A process becomes a zombie when it exits and its parent
process has not yet requested its exit status.  If the parent process is
badly written it may never ask for the exit status and thus the zombie
will never go away: part of the responsibility of a parent process is
reaping its children, so that parent process is just buggy.

However if you kill the parent process then all the parent's children
will be inherited by PID 1 (init, or systemd, or whatever).  One of the
responsibilities of PID 1 is that it reaps all children, so once the
zombie's parent is killed then PID 1 will inherit the zombie and reap
it.




More information about the ubuntu-users mailing list