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

Uncontrollable memory usage #172

Open
rileyai-dev opened this issue Apr 22, 2021 · 4 comments
Open

Uncontrollable memory usage #172

rileyai-dev opened this issue Apr 22, 2021 · 4 comments

Comments

@rileyai-dev
Copy link

Context

I have a NodeJS app which uses puppeteer to scrape an infinite page. While scrolling, I remove the DOM loaded in order to reduce the memory used by puppeteer. When I run the app with puppeteer on my MacOS, it uses 500MB to 800MB but when I run it on zenika/alpine-chrome:89-with-node, it goes up to 2.7GB.

I have the following arguments for the MacOS application:
'--js-flags=--expose-gc', '--single-process', '--no-zygote', '--no-sandbox', '--ignore-certificate-errors'

and the ones for the alpine:
'--js-flags=--expose-gc', '--single-process', '--no-zygote', '--no-sandbox', '--headless', '--disable-gpu', '--ignore-certificate-errors'

For information, the alpine docker runs on Kubernetes which allows me to see in real time the memory used.

Alternatives

Why is it taking so much memory? Is there a way to reduce it? Is there anything I can do to gather enough information to understand what's going on?

@jlandure
Copy link
Member

Hi @GrapevineAI 👋

Thanks for the issue 👍

I don't know so much why/how Chrome is using so much memory...
If you had limitations to your pod (to 800MB for example), does it work?

@rileyai-dev
Copy link
Author

@jlandure My pod has a memory limit and when it is reached, the pod is evicted. The problem is how can I contain the memory usage of Chrome?

@jlandure
Copy link
Member

Hi @GrapevineAI 👋

Sorry for the delay...
Any news about this issue? Did you succeed? 😊

@rileyai-dev
Copy link
Author

@jlandure Unfortunately no... I tried with different distros but got the same issue. I'd be happy to give a https://issuehunt.io/ bounty for anyone who can solve this problem!

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

No branches or pull requests

2 participants