-
-
Notifications
You must be signed in to change notification settings - Fork 3.9k
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
JavaScript heap out of memory on version 6.3.4 #11823
Comments
I came across a similar issue that occured about a year ago #9864 |
We need a mvce to investigate further. |
For more info on what we mean by that: https://stackoverflow.com/help/minimal-reproducible-example A good example for a repro script would be #11138 (comment) |
modify the script to demonstrate your issue const mongoose = require('mongoose');
const testSchema = new mongoose.Schema({
id: String,
registered_at: {
type: Number,
default: Date.now()
},
registered_by: Number,
action: String,
min_ag: {
type: Number,
default: 259200000
},
unv_r: Number,
log_c: Number,
men_r: Number,
ver_r: Number,
mod_r: Number
});
const Test = mongoose.model('Test', testSchema);
async function run() {
await mongoose.connect('mongodb://localhost:27017');
await mongoose.connection.dropDatabase();
await Test.create({
id: '410488579140354049',
registered_by: 12345,
action: 'Action',
unv_r: 1,
log_c: 2,
men_r: 3,
ver_r: 4,
mod_r: 5
});
let data = {unv_r: 10, log_c: 11, men_r: 12, ver_r: 13, mod_r: 14}
await Test.findOneAndUpdate({ id: "410488579140354049"}, data, {new: true, upsert: true} );
console.log('done');
}
run(); |
This issue is stale because it has been open 14 days with no activity. Remove stale label or comment or this will be closed in 5 days |
This issue was closed because it has been inactive for 19 days since being marked as stale. |
Do you want to request a feature or report a bug?
bug
What is the current behavior?
I keep getting
FATAL ERROR: Reached heap limit Allocation failed - JavaScript heap out of memory
when i usefindOneAndUpdate
If the current behavior is a bug, please provide the steps to reproduce.
This is my settings schema:
upon executing the following query, it runs out of memory
What is the expected behavior?
Upon executing that, the process should be complete and it should be saved.
What are the versions of Node.js, Mongoose and MongoDB you are using? Note that "latest" is not a version.
mongoose: v6.3.4
mongoDB: v4.6.0
node: v16.13.2
The text was updated successfully, but these errors were encountered: