You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
On the very first run, it lets me use the database, but starts gradually using up more and more memory while I perform other operations (like TLS connections). Everything slows down and then I get this heap error from Node:
Increasing the memory allocated to the process just makes it use up more memory and increase the heap further (even when supplied 128GB memory which is insane).
However, after the first run, everything works perfectly and is totally fine.
Of course, this isn't consistent -- if I only add one document for the Message and Thread model, it initializes the DB and storage files correctly but it's not until I run the script a second time and try adding several dozen documents that it freezes up, takes up all possibly memory, and then crashes.
I have no idea what could be happening right now and would appreciate any help!
The text was updated successfully, but these errors were encountered:
sounds like there's a infinite loop or recursion somewhere that keeps allocating objects but unfortunately i've forgotten the source code over the years
look for the indexing code and in particular loops or functions that call themselves through async callbacks
It doesn't look like the callback context is being disposed of. The culprit was a TLS connection I had made, consumed and closed in the callback of a model .save. While I would expect the relevant memory to be GC'ed after returning from the callback, instead it seems it was keeping it in memory (and so storing 1000's of TLS connections and their buffers).
To resolve it, I just dumped the result into a queue that I have constantly being consumed to form the relevant connections. Don't know why GC seems to be ignoring the callback.
I'm using LinvoDB3 with leveldown in pure Node, with two simple models:
Message:
Thread:
On the very first run, it lets me use the database, but starts gradually using up more and more memory while I perform other operations (like TLS connections). Everything slows down and then I get this heap error from Node:
Increasing the memory allocated to the process just makes it use up more memory and increase the heap further (even when supplied 128GB memory which is insane).
However, after the first run, everything works perfectly and is totally fine.
Of course, this isn't consistent -- if I only add one document for the Message and Thread model, it initializes the DB and storage files correctly but it's not until I run the script a second time and try adding several dozen documents that it freezes up, takes up all possibly memory, and then crashes.
I have no idea what could be happening right now and would appreciate any help!
The text was updated successfully, but these errors were encountered: