pedroslopez / whatsapp-web.js

A WhatsApp client library for NodeJS that connects through the WhatsApp Web browser app
https://wwebjs.dev
Apache License 2.0
15.46k stars 3.68k forks source link

chrome gives "out of memory error" error. #1950

Closed mraydok closed 11 months ago

mraydok commented 1 year ago

Is there an existing issue for this?

Describe the bug

"chrome" gives "out of memory error".

Expected behavior

"chrome" gives "out of memory error".

Steps to Reproduce the Bug or Issue

  1. Set "headless" of "puppeteer" in "api.js" to "false"
  2. After a while, "chrome" gives "out of memory error".

Relevant Code

No response

Browser Type

Chromium

WhatsApp Account Type

WhatsApp Business

Does your WhatsApp account have multidevice enabled?

Yes, I am using Multi Device

Environment

OS: Windows Phone OS: Android, iOS WhatsApp Web version:2.2301.6

Ekran Alıntısı

No response

Nypat commented 1 year ago

That happens probably because you are out of RAM memory. Try increasing it on the pc you're using to run the code! That same error happened to me some while ago, althought i had 32 RAM, i was running 6 sessions at the same time.

KikeDeAlba commented 1 year ago

How do I increase the ram used by my code?

Nypat commented 1 year ago

adding more RAM to your pc

Nypat commented 1 year ago

or try closing everything else your pc is running, leaving just the code with the whatsapp sesison

KikeDeAlba commented 1 year ago

I have solved the error by adding "--disable-dev-shm-usage" to the args of puppeteer

@mraydok const client = new Client({ puppeteer: { args: ["--no-sandbox", "--disable-dev-shm-usage"], }, authStrategy: new LocalAuth(), });

EmaX093 commented 1 year ago

I have solved the error by adding "--disable-dev-shm-usage" to the args of puppeteer

@mraydok const client = new Client({ puppeteer: { args: ["--no-sandbox", "--disable-dev-shm-usage"], }, authStrategy: new LocalAuth(), });

I doesn't work for me, still got Out of memory, i have 16GB ram and nothing else opened. Task Manager reports only 36% memory usage...

tamer0000000 commented 1 year ago

lower the size of the uploaded image

fedebartoli commented 1 year ago

Running on a Server with 64GB of Ram, basic whatsapp with few chats nothing crazy, go to "out of memory error" after some hours. What can i do to fix this?

At least catching the error would be a nice solution but seems to freeze when going out of memory.

Can someone help?

fedebartoli commented 1 year ago

By the way for anyone having this type of problem the only solution that i found is to put headless: False on puppeteer settings, this solve the problem.

Keith-Web3 commented 1 year ago

@fedebartoli even with headless set to false, the QR code is received but the client never gets connected on my device.