#Memory leak

15 messages · Page 1 of 1 (latest)

paper cypressBOT
#
  • What's your exact discord.js npm list discord.js and node node -v version?
  • Post the full error stack trace, not just the top part!
  • Show your code!
  • Explain what exactly your issue is.
  • Not a discord.js issue? Check out #useful-servers.
  • Issue solved? Press the button!
rain robin
#

FATAL ERROR: Reached heap limit Allocation failed - JavaScript heap out of memory
1: 0xb090e0 node::Abort() [node /home/ec2-user/index.js]
2: 0xa1b70e  [node /home/ec2-user/index.js]
 3: 0xce19d0 v8::Utils::ReportOOMFailure(v8::internal::Isolate*, char const*, bool) [node /home/ec2-user/index.js]
4: 0xce1d77 v8::internal::V8::FatalProcessOutOfMemory(v8::internal::Isolate*, char const*, bool) [node /home/ec2-user/index.js]
5: 0xe993e5  [node /home/ec2-user/index.js]
 6: 0xea90ad v8::internal::Heap::CollectGarbage(v8::internal::AllocationSpace, v8::internal::GarbageCollectionReason, v8::GCCallbackFlags) [node /home/ec2-user/index.js]
7: 0xf0c2d4 v8::internal::ScavengeJob::Task::RunInternal() [node /home/ec2-user/index.js]
8: 0xd9f98b non-virtual thunk to v8::internal::CancelableTask::Run() [node /home/ec2-user/index.js]
 9: 0xb720d4  [node /home/ec2-user/index.js]
10: 0xb756b7 node::PerIsolatePlatformData::FlushForegroundTasksInternal() [node /home/ec2-user/index.js]
11: 0x154c6b6  [node /home/ec2-user/index.js]
12: 0x155ede4  [node /home/ec2-user/index.js]
13: 0x154d008 uv_run [node /home/ec2-user/index.js]
14: 0xa43975 node::SpinEventLoop(node::Environment*) [node /home/ec2-user/index.js]
15: 0xb4b146 node::NodeMainInstance::Run() [node /home/ec2-user/index.js]
16: 0xaccbcc node::Start(int, char**) [node /home/ec2-user/index.js]
17: 0x7f92e5ca413a __libc_start_main [/lib64/libc.so.6]
18: 0xa408ec  [node /home/ec2-user/index.js]```
#

node ver: v18.16.0

vivid bane
#

When you say you monitor it how does the memory consumption develop? And what data do you cache/use/fetch? And how many guilds is your bot in?

vivid bane
#

What intents does your bot use? Because 1k guilds with 450MiB RAM usage can come from cache if you for example cache all guild messages and/or members

rain robin
#

I fetch channel messages,members

rain robin
rain robin
#

I was looking into cache customization. I'm wondering, if I create dynamic channels and then delete a channel at a certain point in time, will it also be removed from the cache? Or do I need to manually define that behavior?

vivid bane
#

Channels will be removed from cache if you delete them and have guilds intent

rain robin
#

Do you got any idea or suggestion how I can handle that?

#

Maybe I just need to increase the heap size?

vivid bane
#

If you need members and messages cached yes.

#

Because those probably make up most of your Ram usage

vivid bane
#

It‘s recommended to think about what intents and caching your bot actually needs and only enable those intents (and maybe limit the caches you don’t need) and increase the heap limit to allow for what you do need