tools: FATAL ERROR: CALL_AND_RETRY_LAST Allocation failed - JavaScript heap out of memory

When I run modulizer --out . I get the following error:

C:\me\myProject>modulizer --out .
[1/2] ��  Converting Package...
Out directory: C:\me\myProject

<--- Last few GCs --->

[20284:000002000B7E6970]    98725 ms: Mark-sweep 1331.6 (1461.2) -> 1331.5 (1461.7) MB, 1729.7 / 0.0 ms  allocation failure GC in old space requested
[20284:000002000B7E6970]   100165 ms: Mark-sweep 1331.5 (1461.7) -> 1331.5 (1426.2) MB, 1438.9 / 0.0 ms  last resort GC in old space requested
[20284:000002000B7E6970]   101887 ms: Mark-sweep 1331.5 (1426.2) -> 1331.5 (1426.2) MB, 1721.4 / 0.0 ms  last resort GC in old space requested


<--- JS stacktrace --->

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

Security context: 00000323F3BA57C1 <JSObject>
    1: stringSlice(aka stringSlice) [buffer.js:560] [bytecode=000001E4864E4D19 offset=94](this=00000145C76822D1 <undefined>,buf=000003B2A364ABF1 <Uint8Array map = 0000039A83F43231>,encoding=00000323F3BB4EB1 <String[4]: utf8>,start=0,end=511355)
    2: oncomplete(aka readFileAfterClose) [fs.js:~489] [pc=000003A4F9AF91C2](this=000002D4084D79B1 <FSReqWrap map = 0000003B0AD34B89>,err=00000145C7682...

FATAL ERROR: CALL_AND_RETRY_LAST Allocation failed - JavaScript heap out of memory
 1: node_module_register
 2: v8::internal::FatalProcessOutOfMemory
 3: v8::internal::FatalProcessOutOfMemory
 4: v8::internal::Factory::NewRawOneByteString
 5: v8::internal::Factory::NewStringFromOneByte
 6: v8::internal::Factory::NewStringFromUtf8
 7: v8::String::NewFromUtf8
 8: v8_inspector::V8InspectorClient::currentTimeMS
 9: node::Buffer::New
10: v8::internal::wasm::SignatureMap::Find
11: v8::internal::Builtins::CallableFor
12: v8::internal::Builtins::CallableFor
13: v8::internal::Builtins::CallableFor
14: 000003A4F99843C1

About this issue

  • Original URL
  • State: open
  • Created 6 years ago
  • Reactions: 5
  • Comments: 16 (6 by maintainers)

Most upvoted comments

@derhuebiii I gave up on this and wrote my own https://github.com/EvolutionJobs/HtmlImport2ESModule

It’s much dumber than this is trying to be, it’s basically a bunch of regexes, but it worked for me for this and #2811 (which was a deal breaker for me as we’re continuing to maintain and develop after the conversion and the hidden <div> tags that this outputs are a mess).

for windows SET NODE_OPTIONS “–max-old-space-size=8192” worked, javascript heap error was resolved. But still conversion did not happen as per #665

I installed the Linux subsystem on my windows development box (ubnuntu from the windows store), then node.js polymer-cli etc.

I could then run Modiulizer without any memory/speed errors on my app.