Closed manandkumaar closed 4 years ago
Issue got resolved after adding node max memory for nx's run-many command.
@manandkumaar can you share what you have changed exactly, since I am having the exact same issue. Thanks!
@EvtK Updating the nx script in package.json as below have resolved the issue.
"ng": "node --max_old_space_size=5048 ./node_modules/@angular/cli/bin/ng",
"nx": "node --max_old_space_size=4096 ./node_modules/@nrwl/cli/bin/nx",
@manandkumaar thanks! sadly it didn't solve my issues :(
@evtk this approach works for me, edit scripts
in package.json file
"app-nx": "node --max-old-space-size=8192 node_modules/@nrwl/cli/bin/nx",
"affected:build": "npm run app-nx affected:build -- --base=master --head=HEAD"
same problem. package-json:
"scripts": { "build": "node --max-old-space-size=8192 node_modules/@nrwl/cli/bin/nx run builder:build:production", }
This issue has been closed for more than 30 days. If this issue is still occuring, please open a new issue with more recent context.
Please make sure you have read the submission guidelines before posting an issue
Prerequisites
Please answer the following questions for yourself before submitting an issue. YOU MAY DELETE THE PREREQUISITES SECTION.
Expected Behavior
Building the app is not running into: FATAL ERROR: Ineffective mark-compacts near heap limit Allocation failed - JavaScript heap out of memory
Current Behavior
After update to "@nrwl/workspace": "9.2.3" build is failing
Failure Information (for bugs)
Please help provide information about the failure if this is a bug. If it is not a bug, please remove the rest of this template.
Steps to Reproduce
Please provide detailed steps for reproducing the issue.
"ng": "node --max_old_space_size=8192 node_modules/@angular/cli/bin/ng.js", "nx": "node --max_old_space_size=8192 node_modules/@nrwl/cli/bin/nx.js", "affected:build": "node --max_old_space_size=8192 node_modules/@nrwl/cli/bin/nx.js affected:build",
Current behavior:-
Expected behavior:-
Context
Please provide any relevant information about your setup:
Failure Logs
--- Last few GCs --->
[3223:0x2f36940] 223468 ms: Mark-sweep 1269.6 (1444.3) -> 1269.6 (1413.3) MB, 1142.4 / 0.0 ms (average mu = 0.333, current mu = 0.000) last resort GC in old space requested [3223:0x2f36940] 224623 ms: Mark-sweep 1269.6 (1413.3) -> 1269.6 (1413.3) MB, 1154.7 / 0.0 ms (average mu = 0.197, current mu = 0.000) last resort GC in old space requested
<--- JS stacktrace --->
==== JS stack trace =========================================
Security context: 0x119757e1e6c1
2: replace [0x119757e105c1](this=0x2704bd50a379 <Very long string[30764579]>,0x09cf34397d29 <JSRegExp <String[18]: [<>\/\u2028\u2029]>>,0x09cf34397dc1 <JSFunction escapeUnsafeChars (sfi = 0x36eb3d242db9)>)
3: serialize(aka serialize) [0x36eb3d243871] [/home/vsts/work/1/s/node_modules/serialize-javascript/index.js...
FATAL ERROR: CALL_AND_RETRY_LAST Allocation failed - JavaScript heap out of memory 1: 0x8fb090 node::Abort() [/opt/hostedtoolcache/node/10.20.1/x64/bin/node] 2: 0x8fb0dc [/opt/hostedtoolcache/node/10.20.1/x64/bin/node] 3: 0xb031ce v8::Utils::ReportOOMFailure(v8::internal::Isolate, char const, bool) [/opt/hostedtoolcache/node/10.20.1/x64/bin/node] 4: 0xb03404 v8::internal::V8::FatalProcessOutOfMemory(v8::internal::Isolate, char const, bool) [/opt/hostedtoolcache/node/10.20.1/x64/bin/node] 5: 0xef7462 [/opt/hostedtoolcache/node/10.20.1/x64/bin/node] 6: 0xf06c7f v8::internal::Heap::AllocateRawWithRetryOrFail(int, v8::internal::AllocationSpace, v8::internal::AllocationAlignment) [/opt/hostedtoolcache/node/10.20.1/x64/bin/node] 7: 0xed682b v8::internal::Factory::NewRawTwoByteString(int, v8::internal::PretenureFlag) [/opt/hostedtoolcache/node/10.20.1/x64/bin/node] 8: 0x10200b3 v8::internal::String::SlowFlatten(v8::internal::Handle, v8::internal::PretenureFlag) [/opt/hostedtoolcache/node/10.20.1/x64/bin/node]
9: 0xb00b74 v8::internal::String::Flatten(v8::internal::Handle, v8::internal::PretenureFlag) [/opt/hostedtoolcache/node/10.20.1/x64/bin/node]
10: 0x11a9331 v8::internal::Runtime_RegExpExecMultiple(int, v8::internal::Object*, v8::internal::Isolate) [/opt/hostedtoolcache/node/10.20.1/x64/bin/node]
11: 0x197e04f5be1d
Other
Same as - https://github.com/nrwl/nx/issues/2755
Screenshot:-![image](https://user-images.githubusercontent.com/2328960/81853614-44244d80-957a-11ea-8cd6-a932b8df0b5d.png)