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

Clear cache and clear cookie #1873

Closed
momokang opened this issue Oct 14, 2023 · 7 comments
Closed

Clear cache and clear cookie #1873

momokang opened this issue Oct 14, 2023 · 7 comments
Labels
enhancement New feature or request needs triage

Comments

@momokang
Copy link

momokang commented Oct 14, 2023

I'm running the app with pm2, but it looks like after awhile, the ram usage will be very high, I suspect it's due to cache and cookie, my current solution is close the browser and run it again every 2 hours, but it is wrong because close the browser randomly might break the transaction.

I like to request (or if there is existing function), to able to clear cache and cookie,
I think it should can be clear on puppeteer ?

I had declared puppeteer options like this

session: 'session',
puppeteerOptions: {
args: [
"--disable-web-security",
"--no-sandbox",
"--disable-setuid-sandbox",
"--disable-web-security",
"--aggressive-cache-discard",
"--disable-cache",
"--disable-application-cache",
"--disable-offline-load-stale-cache",
"--disk-cache-size=0",
"--disable-background-networking",
"--disable-default-apps",
"--disable-extensions",
"--disable-sync",
"--disable-translate",
"--hide-scrollbars",
"--metrics-recording-only",
"--mute-audio",
"--no-first-run",
"--safebrowsing-disable-auto-update",
"--ignore-certificate-errors",
"--ignore-ssl-errors",
"--ignore-certificate-errors-spki-list",
'--use-gl=egl'
],
userDataDir: './tokens/session',
executablePath: executablePath()
},

But the RAM is still going-up and increasing and it will cause user session logout, is there any solution?
Perhaps something like, wppconnection.clearCookie()
Thanks.

@momokang momokang added enhancement New feature or request needs triage labels Oct 14, 2023
@momokang
Copy link
Author

momokang commented Nov 1, 2023

Update: I tried pm2 garbage collection global.gc()
https://stackoverflow.com/questions/28522163/node-js-memory-leak-with-pm2

But unfortunately, it will reload the browser and relogin (Which is not I wanted)
Still seeking for memory leak solution.

@JoaoVitor2310
Copy link

Update: I tried pm2 garbage collection global.gc() https://stackoverflow.com/questions/28522163/node-js-memory-leak-with-pm2

But unfortunately, it will reload the browser and relogin (Which is not I wanted) Still seeking for memory leak solution.

Any new ideas? I'm going through the same problem

@kkedia803
Copy link

Did you solve this issue??

Copy link

@kkedia803, ⭐3 XP earned, 🏆First Comment Added completed!
Contribute more to raise your XP/Level, complete challenges for extra achievements! [Sign up for personal dashboard]

icon

@momokang
Copy link
Author

Nope, I restart the web every 3-4 hours.

Copy link

@momokang, ⭐3 XP earned, 🏆First Comment Added completed, 💪Level 1 achieved!
Contribute more to raise your XP/Level, complete challenges for extra achievements! [Sign up for personal dashboard]

icon

@icleitoncosta
Copy link
Contributor

I am working on version 2, which includes some functions to save resources, a way to avoid storing all messages within the browser. Additionally, I will optimize cache usage and implement a method to avoid constant status synchronization, so we don't need to consume so many WhatsApp resources within the browser's DB store. Follow the process at:
#2302

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request needs triage
Projects
None yet
Development

No branches or pull requests

4 participants