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

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

Open
1 task done
HosseinBabmoradi opened this issue Jul 23, 2024 · 11 comments
Open
1 task done
Labels
bug Something isn't working

Comments

@HosseinBabmoradi
Copy link

HosseinBabmoradi commented Jul 23, 2024

Is there an existing issue for this?

  • I have searched the existing issues

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

  • whatsapp web js: [pedroslopez/whatsapp-web.js#webpack-exodus]
  • Node.js Version: [v21.7.2]
  • Operating System: [Windows]

Additional context

No response

@HosseinBabmoradi HosseinBabmoradi added the bug Something isn't working label Jul 23, 2024
@Hasnen-mr

This comment was marked as off-topic.

@HosseinBabmoradi HosseinBabmoradi changed the title High Memory Usage Due to Remote Auth Caching in wweb_auth File High Memory Usage Due to Remote Auth Caching in wwebjs_auth File Jul 24, 2024
@VigilioYonatan
Copy link

it happend to me, what coud be the problem?

@AKwoKWH
Copy link

AKwoKWH commented Aug 6, 2024

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

@ingGhost
Copy link

ingGhost commented Aug 7, 2024

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

@olivierb24
Copy link

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

@AKwoKWH
Copy link

AKwoKWH commented Sep 2, 2024

same issue, causing my VM frozen and not responding

@postguruji
Copy link

Facing an issue with whatsapp-web.js on Ubuntu. Initially, the RAM usage is around 40% but after 5 to 7 hours of running with the same sessions (no new sessions added), the RAM usage gradually increases to 100%, causing performance issues. 😔

@AKwoKWH
Copy link

AKwoKWH commented Oct 1, 2024

it is now unusable when you use the saved auth. Because when it starts it seems load a massive file and the machine hang.

@correamarques
Copy link

I was experiencing the same issue after deployment on Heroku.
Before this change my app was consuming in average 570mb, now the average is 330mb.

I add some args in the puppeteer options in the file sessions.js inside the clientOptions block:

        headless: true,
        args: [
          '--no-sandbox',
          '--disable-setuid-sandbox',
          '--disable-gpu',
          '--disable-dev-shm-usage',
          '--disable-accelerated-2d-canvas',
          '--disable-web-security',
          '--disable-features=IsolateOrigins,site-per-process',
          '--disable-features=VizDisplayCompositor',
          '--single-process',
          '--no-zygote',
          '--renderer-process-limit=1',
          '--no-first-run',
          '--no-default-browser-check',
          '--disable-background-networking',
          '--disable-background-timer-throttling',
          '--disable-backgrounding-occluded-windows',
          '--disable-breakpad',
          '--disable-client-side-phishing-detection',
          '--disable-component-update',
          '--disable-default-apps',
          '--disable-domain-reliability',
          '--disable-extensions',
          '--disable-hang-monitor',
          '--disable-ipc-flooding-protection',
          '--disable-notifications',
          '--disable-offer-store-unmasked-wallet-cards',
          '--disable-popup-blocking',
          '--disable-prompt-on-repost',
          '--disable-renderer-backgrounding',
          '--disable-sync',
          '--force-color-profile=srgb',
          '--metrics-recording-only',
          '--mute-audio',
          '--no-crash-upload',
          '--no-pings',
          '--password-store=basic',
          '--use-gl=swiftshader',
          '--use-mock-keychain',
          '--disable-software-rasterizer'
        ]

@AnDyro751
Copy link

any update for this?

@templargin
Copy link

+1 here. RAM consumption keeps going up every day.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

10 participants