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

See original GitHub issue

btc-rpc-explorer sometimes crashes while running but not actively serving webpages with FATAL ERROR: Ineffective mark-compacts near heap limit Allocation failed - JavaScript heap out of memory

Environment:

  • Bitcoin Core 18.0
  • NodeJS 10.15.3
  • Code Version / Commit [e.g. ab6cde8]
  • 2 GB RAM with 4 GB swap

Screenshots or Log Output

<--- Last few GCs --->

[7042:0x1b4ce58] 11672336 ms: Mark-sweep 698.2 (723.9) -> 698.2 (724.9) MB, 9005.3 / 0.0 ms  (average mu = 0.076, current mu = 0.001) allocation failure scavenge might not succeed


<--- JS stacktrace --->

==== JS stack trace =========================================

    0: ExitFrame [pc: 0x2576ae9c]
Security context: 0x22d12705 <JSObject>
    1: handleWriteReq(aka handleWriteReq) [0x5c58b675] [internal/stream_base_commons.js:23] [bytecode=0x5d3d9199 offset=139](this=0x2098438d <undefined>,req=0x29ce37a1 <WriteWrap map = 0x3e6301b1>,data=0x29ce3765 <Very long string[199423]>,encoding=0x22d23d99 <String[4]: utf8>)
    2: writeGeneric(aka writeGeneric) [0x5c589185] [internal/stream_base_commons.js:71] [...

FATAL ERROR: Ineffective mark-compacts near heap limit Allocation failed - JavaScript heap out of memory
Aborted

Issue Analytics

  • State:open
  • Created 4 years ago
  • Comments:7 (7 by maintainers)

github_iconTop GitHub Comments

1reaction
janosidecommented, Jan 5, 2021

Thanks for the update. Will try to prioritize a deeper investigation.

0reactions
sangamancommented, Jan 7, 2021

Here’s another snippet from a recent crash in case it helps.

[huge json object from a getRawTransaction call]
"headers":{"content-type":"application/json","date":"Wed, 06 Jan 2021 23:29:19 GMT","content-length":"2037","connection":"
close"},"id":"38f58a3b-03d3-4e6b-9ec1-a2cf45ec20e9","statusCode":200,"type":"response","uri":"http://localhost:8332/"},"msg":"Received response for request 38f58a3b-03d3-4e6b-9ec1-a2cf45ec20e9","time":"2021-01-06T23:29:19.191Z","v":0}
  express:view lookup "index.pug" +8s
  express:view stat "/home/bitcoin/btc-rpc-explorer/views/index.pug" +0ms
  express:view render "/home/bitcoin/btc-rpc-explorer/views/index.pug" +3ms

<--- Last few GCs --->

[2249:0x3834430] 89842906 ms: Mark-sweep (reduce) 497.7 (499.3) -> 497.5 (501.1) MB, 7286.2 / 0.1 ms  (average mu = 0.147, current mu = 0.014) allocation failure scavenge might not succeed
[2249:0x3834430] 89856204 ms: Mark-sweep (reduce) 498.0 (501.1) -> 497.9 (501.3) MB, 9939.4 / 0.1 ms  (average mu = 0.212, current mu = 0.253) allocation failure scavenge might not succeed

Read more comments on GitHub >

github_iconTop Results From Across the Web

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 >
Node.js heap out of memory - Stack Overflow
You can set the node options using an environment variable if you cannot pass them on the command line.
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 >
How to solve JavaScript heap out of memory error
To fix JavaScript heap out of memory error, you need to add the --max-old-space-size option when running your npm command. ... Alternatively, you ......
Read more >
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 >

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