question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

JavaScript heap out of memory on version 6.3.4

See original GitHub issue

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 use findOneAndUpdate

If the current behavior is a bug, please provide the steps to reproduce.

This is my settings 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
}

upon executing the following query, it runs out of memory

settingsSchema.findOneAndUpdate({
    id: "410488579140354049"
}, data, {
    new: true,
    upsert: true
})

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

Issue Analytics

  • State:closed
  • Created a year ago
  • Comments:6

github_iconTop GitHub Comments

1reaction
Uzlopakcommented, May 21, 2022

We need a mvce to investigate further.

0reactions
github-actions[bot]commented, Jun 15, 2022

This issue was closed because it has been inactive for 19 days since being marked as stale.

Read more comments on GitHub >

github_iconTop Results From Across the Web

JavaScript Heap Out Of Memory Error - OpenReplay Blog
A quick solution that you can use to fix "Heap Out Of Memory Error" in JavaScript. We lay out the causes and how...
Read more >
How to Fix JavaScript Heap Out of Memory Error - MakeUseOf
A common problem while working on a JavaScript Node.js project is the “JavaScript heap out of memory” error. This error usually occurs when ......
Read more >
JavaScript heap out of memory - Snyk Support
This generally occurs on larger projects where the default amount of memory allocated by Node (1.5gb) is insufficient to complete the command successfully....
Read more >
Node.js heap out of memory - Stack Overflow
@Keselme An environment variable is a variable that has been set on the server that all processes can read the data from. Open...
Read more >
javaScript Heap Out of Memory Fixed - YouTube
javaScript #javaScriptMemoryCommand to fix: export NODE_OPTIONS=--max_old_space_size=8096Donate to help the channel: ...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found