# running process's of chrome



## pgmrdlm (Sep 7, 2010)

I have been running the port for chrome now for a while and have noticed that it leaves a number of process's running, even when the browser is not open.

```
2517  ??  I      0:00.14 /usr/local/share/chromium/chrome --type=zygote
 6443  ??  I      0:00.14 /usr/local/share/chromium/chrome --type=zygote
 8079  ??  I      0:00.16 /usr/local/share/chromium/chrome --type=zygote
 8567  ??  I      0:00.14 /usr/local/share/chromium/chrome --type=zygote
 8712  ??  I      0:00.14 /usr/local/share/chromium/chrome --type=zygote
12341  ??  I      0:00.15 /usr/local/share/chromium/chrome --type=zygote
16091  ??  I      0:00.14 /usr/local/share/chromium/chrome --type=zygote
16135  ??  I      0:00.14 /usr/local/share/chromium/chrome --type=zygote
16558  ??  I      0:00.14 /usr/local/share/chromium/chrome --type=zygote
19047  ??  I      0:00.15 /usr/local/share/chromium/chrome --type=zygote
19327  ??  I      0:00.15 /usr/local/share/chromium/chrome --type=zygote
23805  ??  I      0:00.17 /usr/local/share/chromium/chrome --type=zygote
25264  ??  I      0:00.13 /usr/local/share/chromium/chrome --type=zygote
25357  ??  I      0:00.14 /usr/local/share/chromium/chrome --type=zygote
25404  ??  I      0:00.15 /usr/local/share/chromium/chrome --type=zygote
26027  ??  I      0:00.13 /usr/local/share/chromium/chrome --type=zygote
26038  ??  I      0:00.14 /usr/local/share/chromium/chrome --type=zygote
26837  ??  I      0:00.14 /usr/local/share/chromium/chrome --type=zygote
29821  ??  I      0:00.14 /usr/local/share/chromium/chrome --type=zygote
34464  ??  I      0:00.14 /usr/local/share/chromium/chrome --type=zygote
47095  ??  I      0:00.15 /usr/local/share/chromium/chrome --type=zygote
48645  ??  I      0:00.13 /usr/local/share/chromium/chrome --type=zygote
52248  ??  I      0:07.59 /usr/local/bin/chrome -incognito
52249  ??  I      0:00.17 /usr/local/bin/chrome -incognito
52250  ??  I      0:00.14 /usr/local/share/chromium/chrome --type=zygote
53672  ??  I      0:00.16 /usr/local/share/chromium/chrome --type=zygote
54612  ??  I      0:00.12 chrome: --type=extension --lang=en-US --force-fieldte
54741  ??  I      0:00.17 /usr/local/share/chromium/chrome --type=zygote
54869  ??  I      0:00.14 /usr/local/share/chromium/chrome --type=zygote
55151  ??  S      0:06.78 chrome: --type=renderer --disable-databases --lang=en
60758  ??  I      0:00.15 /usr/local/share/chromium/chrome --type=zygote
60832  ??  I      0:00.15 /usr/local/share/chromium/chrome --type=zygote
60972  ??  I      0:00.15 /usr/local/share/chromium/chrome --type=zygote
63118  ??  I      0:00.16 /usr/local/share/chromium/chrome --type=zygote
65957  ??  I      0:00.14 /usr/local/share/chromium/chrome --type=zygote
66273  ??  I      0:00.15 /usr/local/share/chromium/chrome --type=zygote
```

Is there any way to identify the process's that should have been terminated??? I think that 
the below process's are this posting:

```
52248  ??  I      0:07.59 /usr/local/bin/chrome -incognito
52249  ??  I      0:00.17 /usr/local/bin/chrome -incognito
```
Looking at the rest of them, would you say that the --type=zygote is the process's that could be killed?

I can script all this out, but would like some second/third opinions here please.


----------



## vertexSymphony (Sep 7, 2010)

Yeah, when you close Chrome some process end up as zombies ... you can kill them safely

`% kill `pgrep chrome``


----------



## anomie (Sep 7, 2010)

I didn't know this about chromium's behavior (and really am not familiar with its inner workings), but it is pretty annoying. I'll have to pay closer attention next time I fire it up. 

@vertexSymphony: 
`% pkill chrome`


----------



## pgmrdlm (Sep 8, 2010)

*well, croncab kills of chrome with --type=zygote didn't work*

I put together a script that identified the pids of chrome that were executing with --type=zygote. Then I tested this against an active chrome session. While the kills didn't close out my browser session, when I opened new tabs and entered a url into them. It would not connect to the web page. It works just fine when no kills have occurred. 

In case anyone is interested, the following is the crontab script I created.

```
/bin/ps -ax | /usr/bin/grep chrome | /usr/bin/grep zygote | /usr/bin/awk '{print $1}' | /usr/bin/xargs kill -9
```

Hmmm, ok. What I can do is find what is always present when an active browser session is happening. That database thing looks promising. In my case, I only run chrome incognito. And if none is found, than list off all chrome sessions and kill em where I see them.

So, before I get generic in this script which won't truly reflect how I browse the internet(incognito). Is anyone else interested in this script to kill zombie chrome session? If not, than I will code it just for myself.


----------



## anomie (Sep 8, 2010)

Seriously, please check out the pkill(1) manpages. That entire pipeline may be summed up (more or less) as: 
`% pkill -9 -f 'chrome.*zygote'`


----------



## pgmrdlm (Sep 8, 2010)

*I didn't know about that command*

Thank you, I did just do a man on that command.  I am so use to piping things that I didn't look further.
Like how you can use regular expressions in that. Now that truely grabs my interest.

Again, thank you.

Chuckle, problem is though. That origional command I did didn't work. It screwed up my active browsers session. lol


----------



## sprewell (Sep 17, 2010)

Hey, the problem is that Chromium depends on the SOCK_SEQPACKET socket type, which was only introduced recently into FreeBSD 9, to kill one of the three default processes that are opened every time you start up the browser.  Basically, Chromium on FreeBSD will leave a single orphaned process behind every time you close the entire browser.  I have a workaround patch for this, that is in the paid subscriber builds.


----------



## pgmrdlm (Sep 18, 2010)

*Thank you*

Unfortunately right now I don't have the cash to be a subscriber. And yes, I do feel I should be.
Thank you for the follow up, very much appreciated.


----------

