After setting max-old-space-size the heap becomes 3mb
- Node.js Version: 14.15.4 32bit
- OS: Windows 10 20H2
Try to increase the node memory but become this: node --max-old-space-size=8192 node_modules/x/index.js
<--- Last few GCs --->
[9852:04089EF0] 44 ms: Mark-sweep 0.9 (3.3) -> 0.9 (3.3) MB, 0.7 / 0.0 ms (average mu = 0.443, current mu = 0.240) allocation failure GC in old space requested
[9852:04089EF0] 45 ms: Mark-sweep (reduce) 0.9 (3.3) -> 0.9 (3.3) MB, 0.7 / 0.0 ms (average mu = 0.363, current mu = 0.242) last resort GC in old space requested
[9852:04089EF0] 46 ms: Mark-sweep (reduce) 0.9 (2.3) -> 0.9 (3.3) MB, 0.9 / 0.0 ms (average mu = 0.203, current mu = 0.009) last resort GC in old space requested
<--- JS stacktrace --->
FATAL ERROR: CALL_AND_RETRY_LAST Allocation failed - JavaScript heap out of memory
node_modules/x/index.js:
console.log('123');
May I ask for help on this one?
I'm also facing the same issue after updating Node version 10.x to 12.x. or 14.x
Node.js Version: 14.15.4 32bit OS: Windows 10 20H2 RAM: 8 GB
yarn run v1.17.3 $ node --max-old-space-size=8192 node_modules/@nrwl/cli/bin/nx serve bci-portal-web-app --port 4203 -c=portal --proxy-config proxy.conf.json --optimization=false
<--- Last few GCs --->
[18516:02DFD808] 119 ms: Mark-sweep 0.9 (3.5) -> 0.9 (3.5) MB, 3.1 / 0.0 ms (average mu = 0.632, current mu = 0.126) allocation failure GC in old space requested [18516:02DFD808] 122 m s: Mark-sweep 0.9 (3.5) -> 0.9 (2.5) MB, 2.0 / 0.0 ms (average mu = 0.545, current mu = 0.180) last resort GC in old space requested [18516:02DFD808] 124 ms: Mark-sweep 0.9 (2.5) -> 0.8 (2.5) MB, 2.4 / 0.0 ms (average mu = 0.395, current mu = 0.020) last resort GC in old space requested
<--- JS stacktrace --->
==== JS stack trace =========================================
0: ExitFrame [pc: 017C6B67]
Security context: 0x22a80451 <JSObject> 1: test [22A84C59](this=0x3135c951 <JSRegExp <String[#14]: (?:^|/).?.$>>,0x3134e8e1 <String[112]: C:\Users\abc..........\node_modules@nrwl\cli\bin\nx>) 2: _findPath [31354CBD] [internal/modules/cjs/loader.js:478] [bytecode=313579FD offset=173](this=0x3134f44d <JSFunction Module (sfi = 24BF80A1)>,0...
FATAL ERROR: CALL_AND_RETRY_LAST Allocation failed - JavaScript heap out of memory
I was only able to resolve this issue by installing the 64-bit version of node.
Ah! That might explain it. Except for special conditions, 32-bit programs on Windows can't use more than 4 GB of memory. https://stackoverflow.com/a/639562 Great catch @IsaacVawter!
I was trying to fix a problem very similar to this a few years back on a server and I found that the dev who installed the Node.js package had installed a different build. Mixing builds between 32 and 64 bit versions of Node could generate errors like this one, so if you are here, double check that you have the correct versions installed.