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

Cache system / ram usage #1221

Open
3 tasks done
zrSadek opened this issue Jul 22, 2024 · 10 comments
Open
3 tasks done

Cache system / ram usage #1221

zrSadek opened this issue Jul 22, 2024 · 10 comments
Labels
bug Something isn't working

Comments

@zrSadek
Copy link

zrSadek commented Jul 22, 2024

Which package has the bugs?

The core library

Issue description

Hi, i think the sweepers etc dont work bcs i always have a big ram usage on simple code if i let them run for many hours, i tried many thing like makecache options, sweepers etc (the code below is not mine i found it on an other issue)

Code sample

const { Client, Options } = require("discord.js-selfbot-v13");
const client = new Client({
  disableEveryone: true,
  sweepers: {
    ...Options.DefaultSweeperSettings,
    messages: {
      interval: 3_600, // Every hour.
      lifetime: 1_800, // Remove messages older than 30 minutes.
    },
  },
});

Package version

latest

Node.js version

18*

Operating system

W11

Priority this issue should have

High (immediate attention needed if possible)

Checklist

  • I have searched the open issues for duplicates.
  • I have shared the entire traceback.
  • I am using a user token (and it isn't visible in the code).

Additional Information

none

@zrSadek zrSadek added the bug Something isn't working label Jul 22, 2024
@aiko-chan-ai
Copy link
Owner

The core is the discord.js library, I didn't change anything about the cache system

@TheDevYellowy
Copy link
Contributor

How large is big ram usage, node itself takes a fair amount of ram, about 50Mb for just running not adding variables and such on top of that.

@zrSadek
Copy link
Author

zrSadek commented Jul 23, 2024

around +50mb per hour

@zrSadek zrSadek closed this as completed Jul 23, 2024
@zrSadek zrSadek reopened this Jul 23, 2024
@zrSadek
Copy link
Author

zrSadek commented Jul 23, 2024

i missclicked on the close btn

@AdamMady
Copy link

I have this same issue it really seem to use more and more ram by time and I have no idea what's causing it.

@002-sans
Copy link
Contributor

there's multiple reason of why your ram increase:

  • Some events like userUpdate can eat your ram
  • Some stupid setInterval like setInterval(() => client.guilds.cache.forEach(() => ...))

@002-sans
Copy link
Contributor

Options.DefaultSweeperSettings -> Options.defaultSweeperSettings

@zrSadek
Copy link
Author

zrSadek commented Aug 18, 2024

oui ca jlai juste repris d'une autre issue qui a ce soucis mais jai quand meme le soucis et jai mm pas de setinterval ou d'event userupdate jcomprends pas

@002-sans
Copy link
Contributor

vient sur discord: sl.js

@zrSadek
Copy link
Author

zrSadek commented Nov 1, 2024

if i use pm2 monit i can see the heap usage growing up

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

5 participants