Project out of memory

#1

Hey, i have the same problem and i dont understand why that dosent working there is some full “out of memory”

0 Likes

"The app exceeded the memory limit" - caught in a loop. How to restart automatically / at all?
#2

Hi @nukleel, welcome to the Glitch forum!

I’ve moved your post to its own topic so we can take a look at it independently. Can you provide your project name so we can take a closer look?

0 Likes

#3

ok thanks, the project was named glitter-vise, it’s a private project say me if you want this not be private

0 Likes

#4

the problem just reveal when i execute a command with my bot

0 Likes

#5

I think I see what might be going on (which is itself unusual - memory leaks are often pretty hard to figure out).

In your bot’s code you’re attaching an event handler to the message event, which is great. Your bot then executes all the code in that event handler every time it gets a message, and in this case that means that your code that attaches a handler to the ready event gets run every time your bot gets a message, so you’re probably attaching dozens (or even hundreds) of separate event listeners to the same event. Each of those listeners takes up a bit of memory, and you really need only one of them.

If you move your event handler starting at https://glitch.com/edit/#!/glitter-vise?path=server.js:46:0 outside of the one that starts at https://glitch.com/edit/#!/glitter-vise?path=server.js:33:0 I think you’ll see a pretty quick improvement.

Let us know how that goes!

0 Likes