SideProjectGuys / invite-manager-bot

A discord bot that tracks invites and much more
https://docs.invitemanager.co/
GNU General Public License v3.0
166 stars 136 forks source link

FatalProcessOutOfMemory #134

Closed Sasiko closed 4 years ago

Sasiko commented 4 years ago

Getting this error due to chrome v8 garbage collection. Note i have later version installed node -v v10.18.1

Is it something i have to manually change with the memory afaik theres strict limit of memory usage on v8.Since whenver it crash the bot loses all its configuration and reset to default

FATAL ERROR: Ineffective mark-compacts near heap limit Allocation failed - JavaScript heap out of memory 1: 0x8fa090 node::Abort() [node] 2: 0x8fa0dc [node] 3: 0xb0052e v8::Utils::ReportOOMFailure(v8::internal::Isolate, char const, bool) [node] 4: 0xb00764 v8::internal::V8::FatalProcessOutOfMemory(v8::internal::Isolate, char const, bool) [node] 5: 0xef4c72 [node] 6: 0xef4d78 v8::internal::Heap::CheckIneffectiveMarkCompact(unsigned long, double) [node] 7: 0xf00e52 v8::internal::Heap::PerformGarbageCollection(v8::internal::GarbageCollector, v8::GCCallbackFlags) [node] 8: 0xf01784 v8::internal::Heap::CollectGarbage(v8::internal::AllocationSpace, v8::internal::GarbageCollectionReason, v8::GCCallbackFlags) [node] 9: 0xf043f1 v8::internal::Heap::AllocateRawWithRetryOrFail(int, v8::internal::AllocationSpace, v8::internal::AllocationAlignment) [node] 10: 0xecd874 v8::internal::Factory::NewFillerObject(int, bool, v8::internal::AllocationSpace) [node] 11: 0x116d9fe v8::internal::Runtime_AllocateInNewSpace(int, v8::internal::Object*, v8::internal::Isolate) [node] 12: 0x32d43d35be1d Debugger listening on ws://127.0.0.1:19229/0cb4e6ea-1a40-4d55-ac41-b1b5e8a9825c For help, see: https://nodejs.org/en/docs/inspector DISCORD CONNECT

Sasiko commented 4 years ago

something to note... when i attempt to change config joinmessage or changing prefix then the bot instantly crashed.. ive assigned 4gb RAM

https://i.imgur.com/5TjZVcM.png

Valandur commented 4 years ago

The bot uses about 100MB RAM + 1MB extra per guild (depending on guild size) when running. It requires a bit more during startup. I'm pretty sure there is something else happening here and not actually the memory running out. Is some other process using all the memory?

Sasiko commented 4 years ago

the bot is only in 1 guild with 36k members only So no idea and im on a dedicated server with 96gb ram with plenty of available space https://i.imgur.com/m01eQXC.png

Logged in as a root when executing npm start and even having same issue when trying to change the prefix

Valandur commented 4 years ago

What version of the bot are you running, the latest master? What version of nodejs and npm are you using? How are you starting the bot?

Sasiko commented 4 years ago

master branch node v10.18.1 npm 6.13.4

npm start

Valandur commented 4 years ago

The newest version of the bot supports node v12, try using that.

Sasiko commented 4 years ago

ok am 12 now although surfacing a new issue. the bot works fine for 21 hours but then stop syncing db at all. tried tagging the bot config but no command responded bot is still online but just unresponsive

bot still logs join and remove precense activity https://i.imgur.com/2Fv4lFf.png https://i.imgur.com/uUVB7or.png

Valandur commented 4 years ago

Are you using MariaDB? There is a know issue with MariaDB. I will close this issue, if you're still having problems please open a new issue so we can keep things separate.