错误处理 ERROR: Ineffective mark-compacts near heap limit Allocation failed - JavaScript heap out of me
【代码】错误处理 ERROR: Ineffective mark-compacts near heap limit Allocation failed - JavaScript heap out of me。
·
项目启动出现错误提示:ERROR: Ineffective mark-compacts near heap limit Allocation failed - JavaScript heap out of me
处理方法:
1. 查看当前值
node -e 'console.log(v8.getHeapStatistics().heap_size_limit/(1024*1024))'
2.扩容,例如下面是扩容到8G:
export NODE_OPTIONS="--max-old-space-size=8192"
也可设置为其他对应扩容值,例如:
export NODE_OPTIONS="--max-old-space-size=5120" # Increase to 5 GB
export NODE_OPTIONS="--max-old-space-size=6144" # Increase to 6 GB
export NODE_OPTIONS="--max-old-space-size=7168" # Increase to 7 GB
export NODE_OPTIONS="--max-old-space-size=8192" # Increase to 8 GB
更多推荐
已为社区贡献1条内容
所有评论(0)