Skip to content
This repository has been archived by the owner on Jan 11, 2024. It is now read-only.

Bot running out of memory #51

Closed
EndBug opened this issue Apr 8, 2020 · 1 comment
Closed

Bot running out of memory #51

EndBug opened this issue Apr 8, 2020 · 1 comment
Labels
type: bug Verified problems that need to be worked on.

Comments

@EndBug
Copy link
Owner

EndBug commented Apr 8, 2020

As the bot is added to more and more servers, discord.js is starting to cache so much data that it exceeds the memory limit.
This problem is, as of now, not going to be fixed, since discord.js relies pretty heavily on internal caching and won't work without it. For more info about that, check discordjs/discord.js#1409

These are the current possible solutions for the bot:

  • Deploy it to a server which has a lot more RAM: this would be both expensive and ineffective in the long term, since the bot could eventually use up more memory.
  • Use sharding and deploy the bot to multiple Heroku instances: this might work, but it would require some work to implement sharding and, considering how the bot works, may not be the best option. Eventually, if the bot approaches ~1000 guilds, it's something that I'll need to do anyway, but I think I'll procrastinate till then.
  • Easiest solution: make the bot reboot periodically. This will "manually" clear the cache, and it's the quickest way to solve the problem for now.
@EndBug EndBug added the type: bug Verified problems that need to be worked on. label Apr 8, 2020
EndBug added a commit that referenced this issue Apr 9, 2020
@EndBug
Copy link
Owner Author

EndBug commented Apr 9, 2020

The bot should now restart every 24 hours. I'll close this issue, for now, I'll reopen it if necessary.

@EndBug EndBug closed this as completed Apr 9, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
type: bug Verified problems that need to be worked on.
Projects
None yet
Development

No branches or pull requests

1 participant