Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Getting GC, process out of memory error while bundling via webpack

Getting following error when bundling my project with webpack. When I have only a few chunk (split) points (require.ensure ones) then it runs okay, but when I increase the split points following error comes.

<--- Last few GCs --->

  124541 ms: Mark-sweep 1379.0 (1457.1) -> 1378.9 (1457.1) MB, 891.6 / 0 ms [allocation failure] [GC in old space requested].
  125398 ms: Mark-sweep 1378.9 (1457.1) -> 1378.9 (1457.1) MB, 857.0 / 0 ms [allocation failure] [GC in old space requested].
  126289 ms: Mark-sweep 1378.9 (1457.1) -> 1378.9 (1457.1) MB, 890.5 / 0 ms [last resort gc].
  127136 ms: Mark-sweep 1378.9 (1457.1) -> 1378.9 (1457.1) MB, 847.1 / 0 ms [last resort gc].


<--- JS stacktrace --->

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

Security context: 0x18342c237339 <JS Object>
    1: get [/path/node_modules/babel-traverse/lib/path/index.js:~75] [pc=0x126413012f98] (this=0x30cb87230cc1 <JS Function NodePath (SharedFunctionInfo 0xa7d7f38b8d9)>,_ref2=0x2b8f0305a311 <an Object with map 0x365041d49801>)
    2: node [/path/node_modules/babel-traverse/lib/index.js:~119] [pc=0x126412dd40f5] (...

FATAL ERROR: CALL_AND_RETRY_LAST Allocation failed - process out of memory
Abort trap: 6
like image 375
Abhinav Singi Avatar asked Jan 11 '16 17:01

Abhinav Singi


1 Answers

This works when I'm increasing size of node, by default it's around 1GB (not sure exact)

Running node by increasing it's memory via --max_old_space_size=4092, it works

Source: https://github.com/webpack/webpack/issues/1875#issuecomment-170663572

like image 142
Abhinav Singi Avatar answered Oct 15 '22 17:10

Abhinav Singi