Focus on achieving your goal, not on fixing the specific tool. If you're trying to kill Chromium's tab processes but not the main process, start by comparing their command lines, e.g. using or ps -efww.pgrep -alf chromium
You'll see that all "child" processes have a parameter like or --type=zygote. Since this directly describes the process' purpose, it will be more reliable than relying on minor differences in the executable name (which has nothing to do it as all Chromium subprocesses are named the same; the fact that "chromium-browser" used to work was just an artifact of Ubuntu's packaging).--type=renderer
Since this is part of the command line, you'll have to use to match it:pkill -f
pkill -f -- "--type=renderer"
pkill -f -- "chromium --type=renderer"
Finally I was able to achieve the desired result by adding and --single-process args at launch (+ --no-zygote is required with them). --no-sandbox
The number of running Chromium processes aren't growing exponentially anymore, but only two instances remain active: one of them is the usual empty tab in the first position, the second is reused correctly by .puppeteer.connect({ browserWSEndpoint })
[...]
const browser = await puppeteer.launch({
headless: true,
args: ['--single-process', '--no-zygote', '--no-sandbox']
})
const browserWSEndpoint = await browser.wsEndpoint()
[...]
: Runs the renderer and plugins in the same process as the browser [source]--single-process
: Disables the use of a zygote process for forking child processes. Instead, child processes will be forked and exec'd directly. Note that --no-sandbox should also be used together with this flag because the sandbox needs the zygote to work. [source]--no-zygote
From this bug report on Launchpad, there is one suggestion found in the comments.
Henry Wertz (hwertz10) wrote on 2016-11-04:
[...] I have an Acer Chromebook 13 (Tegra K1) which had 14.04 on it; Chromium 52 or 53 worked fine. Went to 16.04 (managing to hold back X so I could keep the nvidia driver...) and chromium blew up as others have reported.
I also found the 14.04 build of (at this point, chromium 53) worked fine after I set "--disable-namespace-sandbox"... I had the "Aw, snap!" but found (per google) that "--disable-namespace-sandbox" fixed it without the ill effects of "--no-sandbox".
I had the same problem. Turns out this is a feature of chromium/chrome where it leaves processes running for extensions. To turn off go to Settings-->Show Advanced Settings-->Background Apps and uncheck the "Continue running background apps when Chromium is closed" option. Reference: https://superuser.com/questions/269385/why-does-google-chrome-leave-running-processes-behind-even-after-closing-the-bro
Chromium is like a big problem. It is worst than viruses. I have deleted it in this way:
Shut down your browser and start the Task Manager tool. Try to find all chrome.exe/chromium.exe processes and than terminate them. Open the Start menu and find the Control Panel. Open it and go to the Program and features menu. Here you need to find Chromium and uninstall it.
Open C:\Users\AppData\Local and wipe the Chromium folder. Now, open the web browser you are using and check all its add-ons and extensions. Delete every suspicious item as well as those you don’t remember installing.
Perform a full PC scan using an antimalware tool or antivirus of your choice.
After these steps, I ahve never seen Chromium on my PC. If you want to read more you can read this article https://rocketfiles.com/articles/how-to-remove-chromium-malware-from-windows-10