javascript - 我可以告诉节点使用更大的堆吗?

标签 javascript npm plato

我不知道如何解决这个问题。这是什么意思呢? 我可以以某种方式告诉节点使用更大的堆吗?

plato -r -d 报告项目-ui

<--- 最后几次 GC --->

30399 ms:Scavenge 1400.3 (1472.6) -> 1400.3 (1472.6) MB,0.5/0 ms(自上次 GC 以来+ 1 步中的 2.7 ms)[分配失败] [增量标记延迟标记清除]。 30416 ms:标记-扫描 1400.3 (1472.6) -> 1400.3 (1472.6) MB,17.0/0 ms(自标记开始以来 7 个步骤 + 4.8 ms,最大步骤 2.7 ms)[最后手段 gc]。 30430 ms:标记-扫描 1400.3 (1472.6) -> 1400.3 (1472.6) MB,14.2/0 ms [最后手段 gc]。

<--- JS 堆栈跟踪 --->

==== JS 堆栈跟踪 ========================================== =

安全上下文:0x3b8b68d37399 1:加入(又名加入)[ native array.js:154] [pc = 0x11dbae18bf38](this = 0x3b8b68d04131,o = 0x28d3fc8bf931,v = 3598,C = 0x3b8b68d65a91,B = 0x28d3fc867d31) 2: InnerArrayJoin(又名 InnerArrayJoin) [原生 array.js:331] [pc=0x11dbae18adaa] (this=0x3b8b68d04131 ,C=0x3b8b68d65a91

fatal error :CALL_AND_RETRY_LAST 分配失败 - 进程内存不足 [1] 57084 中止 plato -r -d 报告项目-ui

最佳答案

如果您使用的是 Windows,请尝试此操作

node --max_old_space_size=4096 %AppData%\npm\node_modules\plato\bin\plato -r -d report project-ui

如果你使用的是 unix 试试这个

node --max_old_space_size=4096 /usr/local/lib/node_modules/plato/bin/plato -r -d report project-ui

其中 4096 是以兆字节为单位的内存。

还要确保您使用的是 64-bit version of node因为 32 位应用程序无法分配超过 4GB 的 RAM。

关于javascript - 我可以告诉节点使用更大的堆吗?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/44252981/

相关文章:

javascript - O(1) 方法来查找日期范围内的日期,不包括周末

JavaScript 代码分析 - Plato 的可维护性评级

visual-studio - QR分解Fortran错误

coffeescript - 有没有办法在 coffeescript 上运行柏拉图

javascript - 如何使整个图像比较 slider 居中

javascript - 停止特定属性上的滚动动画

javascript - 多行 D3.js 折线图中的工具提示样式

node.js - 无法安装或启动 npm for React

npm 9 不会复制本地依赖项的 js 文件

node.js - "warning Pattern ["debug@^4.1 的 Yarn(真的)是什么意思。 1"] is trying to unpack in the same destination"