Tuesday, 4 December 2018

CircleCI Angular ng build - Allocation Failure (Memory issue)?

We've been running our builds on circleci for a while. Recently (sometimes) they fail because of allocation failure when running ng build.

The specific build command we are using is

ng build --prod --sourcemaps --aot true --build-optimizer --env=stage

This is the output log.

70% building modules 1562/1562 modules 0 active
79% module and chunk tree optimization         
80% chunk modules optimization
81% advanced chunk modules optimization                     
82% module reviving
83% module order optimization   
84% module id optimization
85% chunk reviving
86% chunk order optimization    
87% chunk id optimization
88% hashing
89% module assets processing
90% chunk assets processing
91% additional chunk assets processing
92% recording 91% additional asset processing   
92% chunk asset optimization
<--- Last few GCs --->

121548 ms: Scavenge 1327.9 (1434.3) -> 1327.8 (1434.3) MB, 21.8 / 0 ms (+ 1.6 ms in 9 steps since last GC) [allocation failure].
121572 ms: Scavenge 1327.9 (1434.3) -> 1327.9 (1434.3) MB, 22.7 / 0 ms (+ 0.3 ms in 1 steps since last GC) [allocation failure].
121595 ms: Scavenge 1327.9 (1434.3) -> 1327.9 (1434.3) MB, 22.9 / 0 ms [allocation failure].
121617 ms: Scavenge 1327.9 (1434.3) -> 1327.9 (1434.3) MB, 22.0 / 0 ms [allocation failure].


<--- JS stacktrace --->
Cannot get stack trace in GC.
FATAL ERROR: Scavenger: semi-space copy
Allocation failed - process out of memory
Aborted (core dumped)
Exited with code 134

When run locally with top filtering to the Pid of node, it hits about 1.4GB of memory usage, without sourcemaps it hits about 800mb.

CircleCI allow 4gb (from what I can find) of memory, I don't understand why I am getting this error (randomly).

Any ideas are much appreciated.



from CircleCI Angular ng build - Allocation Failure (Memory issue)?

No comments:

Post a Comment