Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Zombie process killing memory and cpu #377

Open
ashvin777 opened this issue Oct 5, 2019 · 4 comments
Open

Zombie process killing memory and cpu #377

ashvin777 opened this issue Oct 5, 2019 · 4 comments

Comments

@ashvin777
Copy link

ashvin777 commented Oct 5, 2019

I am using Pageres to generate snapshots for the HTML snippets on my server. As soon as some request for the snapshot, I am executing new Pageres(...).src(..).dest(..).run(..) and it does generate screenshot and saves it. However the chrome instance still remain in my processes which is eating up complete memory and cpu eventually. Is there any handling which we can do to control this behaviour ? It was also creating some defunct(zombies) process as well which I am killing in an interval using a NodeJS script already, but I can't kill these because they might be doing something at that moment of time.

Also the process doesn't respond if any page contains alert in it.

ashvin   24835  0.0  0.2 422124 10956 ?        S    03:24   0:00 /app/node_modules/capture-website/node_modules/puppeteer/.local-chromium/linux-686378/chrome-linux/chrome --type=broker
ashvin   24839  0.0  0.2 422124 10984 ?        S    03:24   0:00 /app/node_modules/capture-website/node_modules/puppeteer/.local-chromium/linux-686378/chrome-linux/chrome --type=broker
ashvin   24845  0.0  0.2 422124 10892 ?        S    03:24   0:00 /app/node_modules/capture-website/node_modules/puppeteer/.local-chromium/linux-686378/chrome-linux/chrome --type=broker
ashvin   24847  0.0  0.2 422124 10956 ?        S    03:24   0:00 /app/node_modules/capture-website/node_modules/puppeteer/.local-chromium/linux-686378/chrome-linux/chrome --type=broker
ashvin   24856  0.0  1.9 559368 77292 ?        Ssl  03:24   0:00 /app/node_modules/capture-website/node_modules/puppeteer/.local-chromium/linux-686378/chrome-linux/chrome --disable-background-networking --enable-features=NetworkService,NetworkServiceInProcess --disable-background-timer-throttling --disable-backgrounding-occluded-windows --disable-breakpad --disable-client-side-phishing-detection --disable-component-extensions-with-background-pages --disable-default-apps --disable-dev-shm-usage --disable-extensions --disable-features=TranslateUI,BlinkGenPropertyTrees --disable-hang-monitor --disable-ipc-flooding-protection --disable-popup-blocking --disable-prompt-on-repost --disable-renderer-backgrounding --disable-sync --force-color-profile=srgb --metrics-recording-only --no-first-run --enable-automation --password-store=basic --use-mock-keychain --headless --hide-scrollbars --mute-audio about:blank --remote-debugging-port=0 --user-data-dir=/tmp/puppeteer_dev_profile-XPIU9c
ashvin   24860  0.0  1.1 414600 45880 ?        S    03:24   0:00 /app/node_modules/capture-website/node_modules/puppeteer/.local-chromium/linux-686378/chrome-linux/chrome --type=zygote --headless --headless
ashvin   24862  0.0  0.3 414600 12768 ?        S    03:24   0:00 /app/node_modules/capture-website/node_modules/puppeteer/.local-chromium/linux-686378/chrome-linux/chrome --type=zygote --headless --headless
ashvin   24878  1.1  1.6 459688 68136 ?        Sl   03:24   0:07 /app/node_modules/capture-website/node_modules/puppeteer/.local-chromium/linux-686378/chrome-linux/chrome --type=gpu-process --field-trial-handle=16199624769558228363,5769851294306486545,131072 --enable-features=NetworkService,NetworkServiceInProcess --disable-features=BlinkGenPropertyTrees,TranslateUI --disable-breakpad --headless --headless --gpu-preferences=KAAAAAAAAAAgAAAgAAAAAAAAYAAAAAAAEAAAAAAAAAAAAAAAAAAAAAgAAAAAAAAA --use-gl=swiftshader-webgl --override-use-software-gl-for-tests --service-request-channel-token=15030834798362936235
ashvin   24879  0.0  1.5 638300 63040 ?        Sl   03:24   0:00 /app/node_modules/capture-website/node_modules/puppeteer/.local-chromium/linux-686378/chrome-linux/chrome --type=renderer --disable-background-timer-throttling --disable-breakpad --enable-automation --file-url-path-alias=/gen=/app/node_modules/capture-website/node_modules/puppeteer/.local-chromium/linux-686378/chrome-linux/gen --force-color-profile=srgb --use-gl=swiftshader-webgl --field-trial-handle=16199624769558228363,5769851294306486545,131072 --enable-features=NetworkService,NetworkServiceInProcess --disable-features=BlinkGenPropertyTrees,TranslateUI --lang=en-US --headless --num-raster-threads=1 --service-request-channel-token=17229192846231744413 --renderer-client-id=3 --shared-files=v8_context_snapshot_data:100,v8_natives_data:101
ashvin   24888  1.2  1.7 641628 71444 ?        Sl   03:24   0:08 /app/node_modules/capture-website/node_modules/puppeteer/.local-chromium/linux-686378/chrome-linux/chrome --type=renderer --disable-background-timer-throttling --disable-breakpad --enable-automation --file-url-path-alias=/gen=/app/node_modules/capture-website/node_modules/puppeteer/.local-chromium/linux-686378/chrome-linux/gen --force-color-profile=srgb --use-gl=swiftshader-webgl --field-trial-handle=16199624769558228363,5769851294306486545,131072 --enable-features=NetworkService,NetworkServiceInProcess --disable-features=BlinkGenPropertyTrees,TranslateUI --lang=en-US --headless --num-raster-threads=1 --service-request-channel-token=3232162327656724735 --renderer-client-id=4 --shared-files=v8_context_snapshot_data:100,v8_natives_data:101
ashvin   24899  0.0  0.2 422124 10896 ?        S    03:24   0:00 /app/node_modules/capture-website/node_modules/puppeteer/.local-chromium/linux-686378/chrome-linux/chrome --type=broker
ashvin   24904  0.0  1.9 559368 77344 ?        Ssl  03:24   0:00 /app/node_modules/capture-website/node_modules/puppeteer/.local-chromium/linux-686378/chrome-linux/chrome --disable-background-networking --enable-features=NetworkService,NetworkServiceInProcess --disable-background-timer-throttling --disable-backgrounding-occluded-windows --disable-breakpad --disable-client-side-phishing-detection --disable-component-extensions-with-background-pages --disable-default-apps --disable-dev-shm-usage --disable-extensions --disable-features=TranslateUI,BlinkGenPropertyTrees --disable-hang-monitor --disable-ipc-flooding-protection --disable-popup-blocking --disable-prompt-on-repost --disable-renderer-backgrounding --disable-sync --force-color-profile=srgb --metrics-recording-only --no-first-run --enable-automation --password-store=basic --use-mock-keychain --headless --hide-scrollbars --mute-audio about:blank --remote-debugging-port=0 --user-data-dir=/tmp/puppeteer_dev_profile-GEX7He
ashvin   24908  0.0  1.1 414600 45664 ?        S    03:24   0:00 /app/node_modules/capture-website/node_modules/puppeteer/.local-chromium/linux-686378/chrome-linux/chrome --type=zygote --headless --headless
ashvin   24910  0.0  0.3 414600 12836 ?        S    03:24   0:00 /app/node_modules/capture-website/node_modules/puppeteer/.local-chromium/linux-686378/chrome-linux/chrome --type=zygote --headless --headless
ashvin   24930  1.1  1.6 459688 68164 ?        Sl   03:24   0:07 /app/node_modules/capture-website/node_modules/puppeteer/.local-chromium/linux-686378/chrome-linux/chrome --type=gpu-process --field-trial-handle=13166300288844996414,5767979230849430141,131072 --enable-features=NetworkService,NetworkServiceInProcess --disable-features=BlinkGenPropertyTrees,TranslateUI --disable-breakpad --headless --headless --gpu-preferences=KAAAAAAAAAAgAAAgAAAAAAAAYAAAAAAAEAAAAAAAAAAAAAAAAAAAAAgAAAAAAAAA --use-gl=swiftshader-webgl --override-use-software-gl-for-tests --service-request-channel-token=7199412027662144235
ashvin   24931  0.0  1.5 638300 63680 ?        Sl   03:24   0:00 /app/node_modules/capture-website/node_modules/puppeteer/.local-chromium/linux-686378/chrome-linux/chrome --type=renderer --disable-background-timer-throttling --disable-breakpad --enable-automation --file-url-path-alias=/gen=/app/node_modules/capture-website/node_modules/puppeteer/.local-chromium/linux-686378/chrome-linux/gen --force-color-profile=srgb --use-gl=swiftshader-webgl --field-trial-handle=13166300288844996414,5767979230849430141,131072 --enable-features=NetworkService,NetworkServiceInProcess --disable-features=BlinkGenPropertyTrees,TranslateUI --lang=en-US --headless --num-raster-threads=1 --service-request-channel-token=3289548466366765071 --renderer-client-id=3 --shared-files=v8_context_snapshot_data:100,v8_natives_data:101
ashvin   24932  1.3  1.7 641628 70812 ?        Sl   03:24   0:08 /app/node_modules/capture-website/node_modules/puppeteer/.local-chromium/linux-686378/chrome-linux/chrome --type=renderer --disable-background-timer-throttling --disable-breakpad --enable-automation --file-url-path-alias=/gen=/app/node_modules/capture-website/node_modules/puppeteer/.local-chromium/linux-686378/chrome-linux/gen --force-color-profile=srgb --use-gl=swiftshader-webgl --field-trial-handle=13166300288844996414,5767979230849430141,131072 --enable-features=NetworkService,NetworkServiceInProcess --disable-features=BlinkGenPropertyTrees,TranslateUI --lang=en-US --headless --num-raster-threads=1 --service-request-channel-token=7812770114642875707 --renderer-client-id=4 --shared-files=v8_context_snapshot_data:100,v8_natives_data:101
ashvin   24949  0.0  0.2 422124 10880 ?        S    03:24   0:00 /app/node_modules/capture-website/node_modules/puppeteer/.local-chromium/linux-686378/chrome-linux/chrome --type=broker
ashvin   25399  0.0  0.0  12944   984 pts/0    S+   03:35   0:00 grep --color=auto chrome
@ashvin777 ashvin777 changed the title Zombies process killing memory and cpu Zombie process killing memory and cpu Oct 5, 2019
@sindresorhus
Copy link
Owner

Most likely a Puppeteer issue. You might find some useful info here: puppeteer/puppeteer#1825

@3ruce
Copy link

3ruce commented Nov 29, 2019

Can't you try something like this to see if you have any zombie instances of Pageres and/or Chrome?

## check for pageres		
if pgrep pageres > /dev/null 
		then
    			killall pagere
		else
	 		echo "We are not running Pageres"
		fi

## check for chrome		
if pgrep chrome > /dev/null 
		then
    			killall chrome
		else
	 		echo "We are not running Chrome"
		fi

@sindresorhus
Copy link
Owner

Try the latest version: https://github.com/sindresorhus/pageres/releases/tag/v7.0.0 It may have resolved the issue.

@3ruce
Copy link

3ruce commented Aug 30, 2022

Thank you...

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants