Lots of defunct sh zombie processes

12,621

Solution 1

lsof -p 32637

will give you more information on the process. Looking at the parent process that is causing this can help prevent it.

Solution 2

Do they use up any system resources?

I believe not much other than a slot in the process table.

how to stop this from happening?

Identify what is their parent process that spawned them and find out why it isn't waiting for its children to die (and hence not reaping them)

how to kill these processes?

You can't kill something that is already dead. If the parent is killed, init should eventually inherit them and reap them for you.

Share:
12,621

Related videos on Youtube

skerit
Author by

skerit

Updated on September 18, 2022

Comments

  • skerit
    skerit over 1 year

    I have a lot of defunct sh processes running. When I execute this command, to count them:

    ps -ax | grep sh | wc -l
    

    It says I’ve got 2655 at the moment. Do they use up any system resources? I have no idea where they’re coming from, this is the only data the ps command gives me:

    32637 ?        Z      0:00 [sh] <defunct>
    

    Does anyone know how to stop this from happening, and how to kill these processes?

  • skerit
    skerit over 11 years
    Thanks, some defunct processes didn't have any information, others showed files from an sshfs mount were open. At least I know where to look now.