Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Memory allocation error when using quickmongo #62

Open
whoisdon opened this issue Jul 1, 2023 · 6 comments
Open

Memory allocation error when using quickmongo #62

whoisdon opened this issue Jul 1, 2023 · 6 comments

Comments

@whoisdon
Copy link

whoisdon commented Jul 1, 2023

When using the quickmongo module, I am encountering a memory allocation error that results in an unexpected termination of my application. The problem occurs during the execution of certain operations and is independent of the amount of available memory on the device. Below is a detailed description of the issue:

Initialize the connection to MongoDB using quickmongo.
Execute a specific operation, such as a query or data insertion.
The error occurs, and the application terminates with the following error message:

image

Operating System: Debian
Node.js Version: v18.12.1
quickmongo Version: v18.12.1

@whoisdon
Copy link
Author

whoisdon commented Jul 1, 2023

LoL, I did the basic search for the error. Responses generated by ChatGPT will not solve this problem.

@Zelak312
Copy link
Collaborator

Zelak312 commented Jul 1, 2023

Hey, I believe the amount of data you request exceeds the amount Node sets for the JavaScript heap. Which unfortunately isn't something we can do to fix that.

If you are not requesting a lot of data then that could be a bug.

There is a way to make Node's heap limit bigger since as you stated, it doesn't take the full ram.

That would be like a workaround if you ask me. If you have a lot of data it should be probably separated in more manageable blocks instead of a whole big block of data.

Without knowing how much/what data you are loading, I cannot do much more than that.

I would also point out that quickmongo is not really maintained anymore as you can see from the last commit date

@whoisdon
Copy link
Author

whoisdon commented Jul 1, 2023

Well, I am carrying 4 objects that contain short strings, it doesn't make sense to be overloading, and besides, when I access what I supposedly stored, it returns an unimaginable amount of null contents in an array in the database.

image

@Zelak312
Copy link
Collaborator

Zelak312 commented Jul 1, 2023

That is the first time I see something like that, the last release hasn't been changed for quite a while. The nulls are probably something that happened in the way you used quickmongo that wasn't normal or added them without intending to do so. That is probably why it gets quite big and goes over the memory limit.

Without code and knowing what you load or an example of it. I cannot do much as I stated earlier. It is also impossible for us to change the memory limit as you can only do it when you run Node

@whoisdon
Copy link
Author

whoisdon commented Jul 1, 2023

Yes, but regardless, I can't wrap my head around this overload for creating a bot on Discord. I'll provide you with the connection and how I'm using it:

-> BanCommand.js https://sourceb.in/hQLZIFOxeQ
-> BansCommand.js https://sourceb.in/N44xC2b028
-> KickCommand.js https://sourceb.in/a1dvtGCZpQ
-> UnBanCommand.js https://sourceb.in/tWkzieWSnG

Structure and Connection -> https://sourceb.in/xvf4DgFHxp
Command Structure -> https://sourceb.in/Iv1lYcrdTh

That's basically it. I neither use nor send any more data than what was mentioned above. If you can find what is supposedly sending thousands of null data, I would be grateful!

@Zelak312
Copy link
Collaborator

Zelak312 commented Jul 1, 2023

I am unsure what could be the cause of all of these nulls you have. It could come from something you had before but changed like it could also come from another program or anything that used the mongodb database you are using with quickmongo.

Unfortunately, I am not in charge of quickmongo but I do reply to people to help solve issues since nobody else really does it. That problem though is more technical than a simple problem of just mis using quickmongo.
I don't have a lot of knowledge of how it works internally as I am not the last developer who worked on this (for a quick story this repo was given to plexidev from another developer but nobody has actually tried taking the responsibility for it)

With that being said, I am not sure if I will be able to provide you with a fix for your issue as I personally don't have time for working on quickmongo

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants