gpt4 book ai didi

javascript - 获取 GC,在通过 webpack 捆绑时处理内存不足错误

转载 作者:数据小太阳 更新时间:2023-10-29 03:49:47 26 4
gpt4 key购买 nike

将我的项目与 webpack 捆绑在一起时出现以下错误。当我只有几个 block (拆分)点(require.ensure 点)时它运行正常,但是当我增加拆分点时出现错误。

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

关于javascript - 获取 GC,在通过 webpack 捆绑时处理内存不足错误,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/34727743/

26 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com