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

I’m getting a JavaScript heap out of memory error when trying to run tsc --noEmit. Node version: v10.16.0 TypeScript: 3.4.3 ts-loader: 5.4.5 ts-node: 8.1.0

I guess the problem can be fixed by upgrading the dependencies to the latest versions and increasing max-old-space-size, but that’s unfortunately not possible yet in my current project 😦


<--- Last few GCs --->

[23026:0x4400980]    40880 ms: Scavenge 1384.8 (1423.9) -> 1384.4 (1424.4) MB, 12.3 / 0.0 ms  (average mu = 0.165, current mu = 0.085) allocation failure
[23026:0x4400980]    40893 ms: Scavenge 1385.1 (1424.4) -> 1384.7 (1424.9) MB, 7.9 / 0.0 ms  (average mu = 0.165, current mu = 0.085) allocation failure
[23026:0x4400980]    41493 ms: Mark-sweep 1385.4 (1424.9) -> 1384.9 (1424.9) MB, 595.0 / 0.0 ms  (average mu = 0.113, current mu = 0.056) allocation failure scavenge might not succeed


<--- JS stacktrace --->

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

    0: ExitFrame [pc: 0xb91310dbe1d]
Security context: 0x1e0c9099e6e9 <JSObject>
    1: addPropertyToElementList(aka addPropertyToElementList) [0x21d642b90aa9] [/mnt/c/dev/node_modules/typescript/lib/tsc.js:~28448] [pc=0xb9131ad340a](this=0x0c2a182026f1 <undefined>,propertySymbol=0x16d1c4d04069 <Symbol map = 0x6cba608dd59>,context=0x262e61498bc1 <Object map = 0x15291fe33dc9>,typeElements=0x332e3ae4a389 <JSArray[0]>)
    2: createTy...

FATAL ERROR: Ineffective mark-compacts near heap limit Allocation failed - JavaScript heap out of memory
 1: 0x8f9d10 node::Abort() [node]
 2: 0x8f9d5c  [node]
 3: 0xaffd0e v8::Utils::ReportOOMFailure(v8::internal::Isolate*, char const*, bool) [node]
 4: 0xafff44 v8::internal::V8::FatalProcessOutOfMemory(v8::internal::Isolate*, char const*, bool) [node]
 5: 0xef4152  [node]
 6: 0xef4258 v8::internal::Heap::CheckIneffectiveMarkCompact(unsigned long, double) [node]
 7: 0xf00332 v8::internal::Heap::PerformGarbageCollection(v8::internal::GarbageCollector, v8::GCCallbackFlags) [node]
 8: 0xf00c64 v8::internal::Heap::CollectGarbage(v8::internal::AllocationSpace, v8::internal::GarbageCollectionReason, v8::GCCallbackFlags) [node]
 9: 0xf038d1 v8::internal::Heap::AllocateRawWithRetryOrFail(int, v8::internal::AllocationSpace, v8::internal::AllocationAlignment) [node]
10: 0xeccd54 v8::internal::Factory::NewFillerObject(int, bool, v8::internal::AllocationSpace) [node]
11: 0x116cede v8::internal::Runtime_AllocateInNewSpace(int, v8::internal::Object**, v8::internal::Isolate*) [node]
12: 0xb91310dbe1d
[1]    23026 abort (core dumped)  npx tsc --noEmit

Issue Analytics

  • State:open
  • Created 4 years ago
  • Reactions:5
  • Comments:38

github_iconTop GitHub Comments

2reactions
zerniecommented, Oct 4, 2019

@Eyas btw, the resulting typings file for schema-dts is huge - ~10k LOC. I wonder if breaking it into a smaller not interconnected pieces can help.

1reaction
Eyascommented, Nov 26, 2020

Hi all – I managed to reproduce a related issue more reliably, and changes in 0.8.1 should address it. I’m not sure if it’s enough per se, but I’m noticing notable improvements on my end.

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 - javascript - Stack Overflow
I have a 64-bit CPU and I've installed x86 node version, which caused the CALL_AND_RETRY_LAST Allocation failed - JavaScript heap out of memory ......
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 >
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 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 >

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