How to kill zombie processes in Ubuntu 18.04

Linux terminal

Although the Ubuntu repositories contain very powerful and stable programs, it may happen that during some work session with our Ubuntu 18.04 we create zombie processes. The processes or zombie programs are programs that do not work but that consume resources on our computer.

These processes can cause the computer to run slower and even stop working if the process is quite important or takes up a lot of system memory. In Ubuntu you can solve this operating problem thanks to the terminal or the desktop. Personally I prefer solve these zombie processes through the terminal as it consumes less resources and it loads the operating system less. Thus, first we have to execute the top command that will show us all the processes that are taking place in Ubuntu. Once we have the information we will see the number of zombie processes that the operating system has; but it does not tell us what processes they are. To know this we have to execute the following code in the terminal:

ps axo stat,ppid,pid,comm | grep -w defunct

After running this, in the terminal We will see the name and number of the zombie processes that Ubuntu has. Now we have to kill all those zombie processes so that Ubuntu gets rid of them. To do this, we have to execute the following command in the terminal with each zombie process:

sudo kill -9 NUMERO DEL PROCESO

This will kill the process but we have to do it one at a time. Once we have this done, we will notice how Ubuntu works correctly or faster and more efficiently. Graphically it can be done in the same way through the System Monitor.

A little trick to improve the performance of our Ubuntu 18.04 for the future, is to locate those zombie processes and relate them to the programs in such a way that if LibreOffice habitually creates zombie processes, then replace LibreOffice with another office suite. And so with every zombie process we have. It won't be much because a program that causes problems usually generates several zombie processes.


A comment, leave yours

Leave a Comment

Your email address will not be published. Required fields are marked with *

*

*

  1. Responsible for the data: Miguel Ángel Gatón
  2. Purpose of the data: Control SPAM, comment management.
  3. Legitimation: Your consent
  4. Communication of the data: The data will not be communicated to third parties except by legal obligation.
  5. Data storage: Database hosted by Occentus Networks (EU)
  6. Rights: At any time you can limit, recover and delete your information.

  1.   Andreale Dicam said

    I had never read an article like this, the info is very useful, thank you very much. I have run the command several times at different times and it turns out to be a single zombie process that is not really a bother, so wearing an Ubuntu-based distribution was very clean to run.