通过webpack绑定时,获取GC,进程内存不足错误



将我的项目与webpack绑定时出现以下错误。当我只有几个chunk(split)点(必需。确保一个)时,它运行正常,但当我增加split点时,就会出现错误。

<--- 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

当我增加节点的大小时,这是有效的,默认情况下大约是1GB(不确定确切的)

通过--max_old_space_size=4092增加节点的内存来运行节点,它工作于

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

最新更新