Next Previous Contents

7. Linux Internals Most Frequently Asked Questions

7.1 What are zombie processes?

When a child process finishes, its parent process is supposed to ``reap'' it, which really just means that it acknowledges the fact that the child exited, and checks its return status.

Zombies are un-reaped child processes. They occupy no memory, no disk, no IO and no CPU. They only eat a slot in the process table. Normally, this is not a problem, but it becomes troublesome on heavily loaded machines running near the process limit, or in cases where a program spawns child processes often, but reaps rarely. This is usually a bug, and can lead to system crashes. When the parent exits, any un-reaped processes will be reaped by init, but this can take a long time if the system is busy. Lots of zombies can be infuriating, because they can prevent you from running the commands you need to run to clean them up. Unclean shutdowns are the only fix if that happens, although sometimes you can get room to move by disconnecting the network and all modems (run-away server daemons will eventually time out on all of their connections, and start exiting. This will reduce the system load, and hopefully lead to some process reaping, at least enough for you to get a shell on the console and start cleaning up).

Alternatively you could set limits with ulimit before running risky tasks.

7.2 Kernel panic - no root device

Make sure you compiled your root device driver correctly in your kernel. Unless you use a ramdisk, this device driver shouldn't be a module (since modules, in this case, would reside on the root file system, which hasn't been mounted yet).

You may also want to make sure that ``rdev vmlinuz'' and the root device of the system are the same.

It is HIGHLY recommended that you leave your old kernel in /etc/lilo.conf when trying a new one, so you can boot the old kernel in case of trouble.

7.3 Memory Usage Questions

I always get information about different memories: shared, buffered, swap, user, system. What do they mean? Is it possible to control usage of the memory?

Briefly:

``shared'' means that the memory is (or could be) shared by multiple processes. This typically applies to executables, libraries, and files which are mmap()d read-only.

``swap'' refers to swap space.

``buffers'' and ``cached'' refer to memory that is holding some part of a file. Note that this memory will be used by programs once the ```free'' memory is exhausted.

``free'' means memory that is used for absolutely nothing, i.e. it is effectively wasted. When a process terminates, its writable memory becomes ``free''. Also, if a file is deleted, any memory which was caching that file becomes ``free''.

``used'' means that the memory belongs to a specific process.

No it's not possible to control memory usage directly, although you can set some limits with ulimit.


Next Previous Contents