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.05k stars 3.58k forks source link

High Memory Usage Due to Remote Auth Caching in wwebjs_auth File #3222

Open HosseinBabmoradi opened 1 month ago

HosseinBabmoradi commented 1 month ago

Is there an existing issue for this?

Describe the bug

I'm experiencing significant memory usage problems with the remote auth feature in my application. Specifically, the caching of data in the wweb_auth file is causing my server to consume a large amount of RAM, around 20GB, which is unsustainable. I have around 70 customers, and the frequent synchronization with MongoDB (every 60 seconds) is not alleviating the memory pressure.

Expected Behavior

I would expect the remote auth mechanism to handle authentication data more efficiently, without causing excessive memory usage. Ideally, it should be possible to configure it to use less RAM or to avoid keeping large amounts of data in memory.

Actual Behavior

The wweb_auth file caching mechanism is causing the application to consume around 20GB of RAM. This high memory usage is not sustainable and leads to performance issues.

Steps to Reproduce the Bug or Issue

  1. Enable remote auth in the application.
  2. Run the application with a significant number of users (e.g., 70 customers).
  3. Observe memory usage over time.

Relevant Code

No response

Browser Type

Chromium

WhatsApp Account Type

Standard

Does your WhatsApp account have multidevice enabled?

Yes, I am using Multi Device

Environment

Additional context

No response

Hasnen-mr commented 1 month ago

Agree, its happed after webcacheversion remove

VigilioYonatan commented 1 month ago

it happend to me, what coud be the problem?

AKwoKWH commented 1 month ago

Same issue, it takes forever for loading up and for the client get ready.

ingGhost commented 1 month ago

any update for this? its happen to me. and when service restart, more client sign out automaticly

olivierb24 commented 1 month ago

Same issue here, I'm sure there is a way to reduce the memory usage....

AKwoKWH commented 1 week ago

same issue, causing my VM frozen and not responding