allocation failure scavenge might not succeed


原文链接:allocation failure scavenge might not succeed – 每天进步一点点 (longkui.site)
0.背景

angular项目,执行build指令时报错。

Scavenge 4024.7 (4115.4) -> 4018.7 (4119.9) MB, 24.5 / 0.0 ms  (average mu = 0.582, current mu = 0.227) allocation failure
Mark-sweep 4028.9 (4119.9) -> 4015.0 (4129.9) MB, 2407.0 / 0.1 ms  (average mu = 0.493, current mu = 0.220) allocation failure scavenge might not succeed
......................................(中间省略)
young object promotion failed Allocation failed - JavaScript heap out of memory
1.解决办法

把项目重启了几遍还是不行, 查看网上的办法说把内存调大点,

node --max_old_space_size=4096 ./node_modules/@angular/cli/bin/ng build --prod --base-href=.

改成了

node --max_old_space_size=8182 ./node_modules/@angular/cli/bin/ng build --prod --base-href=.

结果还是不行。好吧继续改

node --max_old_space_size=10000 ./node_modules/@angular/cli/bin/ng build --prod --base-href=.

我电脑内存16G。所以及改的大一点。改成10000之后,执行打包指令就OK了。

大家如果遇到上面的报错,就尝试把内存调大一点就行。


免责声明!

本站转载的文章为个人学习借鉴使用,本站对版权不负任何法律责任。如果侵犯了您的隐私权益,请联系本站邮箱yoyou2525@163.com删除。



 
粤ICP备18138465号  © 2018-2025 CODEPRJ.COM