gpt4 book ai didi

node.js - Angular 5 npm 构建崩溃(重新平衡分配失败 - 进程内存不足)

转载 作者:太空宇宙 更新时间:2023-11-04 02:45:52 26 4
gpt4 key购买 nike

我已经构建了一个 Angular 5 门户网站。

在我的本地 Mac 上运行命令时成功。

npm run build

但是,当在 Linux 服务器上运行相同的程序时,它会崩溃并出现错误:

Cannot get stack trace in GC.
FATAL ERROR: NewSpace::Rebalance Allocation failed - process out of memory
1: node::Abort() [ng]
2: 0x121a7ac [ng]
3: v8::Utils::ReportOOMFailure(char const*, bool) [ng]
4: v8::internal::V8::FatalProcessOutOfMemory(char const*, bool) [ng]
5: 0xaea73b [ng]
6: v8::internal::MarkCompactCollector::Evacuate() [ng]
7: v8::internal::MarkCompactCollector::CollectGarbage() [ng]
8: v8::internal::Heap::MarkCompact() [ng]
9: v8::internal::Heap::PerformGarbageCollection(v8::internal::GarbageCollector, v8::GCCallbackFlags) [ng]
10: v8::internal::Heap::CollectGarbage(v8::internal::AllocationSpace, v8::internal::GarbageCollectionReason, v8::GCCallbackFlags) [ng]
11: v8::internal::Factory::NewFillerObject(int, bool, v8::internal::AllocationSpace) [ng]
12: v8::internal::Runtime_AllocateInTargetSpace(int, v8::internal::Object**, v8::internal::Isolate*) [ng]
13: 0x18aab070463d

服务器的CPU配置:

description: CPU
product: Virtual CPU 714389bda930
vendor: Intel Corp.
physical id: 400
bus info: cpu@0
version: pc-i440fx-2.10
slot: CPU 0
size: 2GHz
capacity: 2GHz
width: 64 bits

内存:

description: System Memory
physical id: 1000
size: 1GiB
capacity: 1GiB

提前致谢。

内存限制是原因还是还有其他原因?

最佳答案

我确实喜欢这个,它对我有用
转到您的 Node 模块文件夹 bin 例如:D:...\node_modules\.bin
使用notepad++,然后在文件中查找“--max-old-space-size=10240”,用“--max-old-space-size=1024000”重装(重装所有内部文件)
您可以通过打开 .bin 文件夹中的任何文件找到值 --max-old-space-size例如文件“acorn”

change limit memory

关于node.js - Angular 5 npm 构建崩溃(重新平衡分配失败 - 进程内存不足),我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/48819640/

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