Monday, 24 April 2017

FATAL ERROR: CALL_AND_RETRY_LAST Allocation failed - ng test --watch

I am developing an angular-cli app in the following environment:

OS: Windows 10
Nodejs: 6.9.2
npm: 3.3.10
angular-cli: 1.0.0-beta.25.5

When I change the code while doing ng test --watch, everytime I get the following error:

<--- Last few GCs --->

  541882 ms: Mark-sweep 1369.1 (1393.2) -> 1369.0 (1394.2) MB, 233.9 / 0.1 ms [allocation failure] [GC in old space requested].
  542130 ms: Mark-sweep 1369.0 (1394.2) -> 1369.0 (1395.2) MB, 248.3 / 0.0 ms [allocation failure] [GC in old space requested].
  542384 ms: Mark-sweep 1369.0 (1395.2) -> 1369.0 (1394.2) MB, 253.6 / 0.0 ms [last resort gc].
  542632 ms: Mark-sweep 1369.0 (1394.2) -> 1369.0 (1394.2) MB, 248.9 / 0.0 ms [last resort gc].


<--- JS stacktrace --->

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

Security context: 000001EE28FCFB61 <JS Object>
    1: toString [buffer.js:~487] [pc=000002AB3E7A5497] (this=000001E2642F0C41 <an Uint8Array with map 0000001D5B706569>)
    2: /* anonymous */ [C:\dev\{my_project}\node_modules\karma\lib\preprocessor.js:122] [pc=000002AB3E7A9B68] (this=000001EE28FE6659 <JS Global Object>,err=000001EE28F04201 <null>,thisFileIsBinary=000001E...

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

node --max_old_space_size=4096 node_modules/angular-cli/bin/ng test --watch solved this problem but ideally I'd like to use just ng test command. Other than that, I tried to migrate my project to angular-cli@1.0.0 and ng test --max_old_space_size=4096 but they didn't work.

Is there any way to fix this issue just using ng test command?

Thanks in advance.



via jhmt

No comments:

Post a Comment