2

I've tried both variants and neither of them works.

 const browser = await puppeteer.launch({ args: [ '--max_old_space_size=1024', ], headless: true, }); 

and

 const browser = await puppeteer.launch({ args: [ '--js-flags="--max_old_space_size=1024"', ], headless: true, }); 

What am I doing wrong?

1 Answer 1

3

I am not sure if it gonna work as the max. memory usage that can be set varies between platforms, but about the syntax I am sure you should use dashes instead of underscores in --max-old-space-size if you try to set it via --js-flags:

await puppeteer.launch({ headless: true, args: [ '--js-flags="--max-old-space-size=1024"' ] }); 
Sign up to request clarification or add additional context in comments.

1 Comment

Sure! It was copied from some random site and is evidently wrong.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.