#Memory Leak
15 messages · Page 1 of 1 (latest)
What intents does your bot have? And does it have custom cache settings or sweepers?
const client = new Client({
intents: [Guilds, MessageContent, GuildMessages, GuildMembers],
});
and i dont have any costum cache settings or sweepers im even not using a single global variable it is just a small application
In how many guilds is that bot and how many members and channels do those have?
Because those intents will mostly cache 200 messages per text based channel and all members that your bot ever received in payloads
its in 2 guilds and each has about 300 members / about 50 channel.
What else does it do? Any fetches from URLs, what additional packages beside djs do you have installed, …?
wanna see the githubrepo?
That would be an easy approach yes
Well thats a pretty big codebase
I'd recommend using the inspect flag and trying to track down what object is taking up the most memory https://nodejs.org/en/guides/debugging-getting-started
its my first node project recent graduated but thx then for the help
Couple of things I noticed:
- you don’t need neither GuildMessages, MessageContent nor GuildMembers intent for anything you do in your code afaict
- for a ts bot code you sure got a lot of
any
- you make two clients in your main file only to login with the second and not use the first one at all
- you have two canvas packages installed but probably don’t use both