You need to enable JavaScript to run this app.
优惠活动
大模型
产品
解决方案
定价
更多

Angular集成CKEditor5时出现Heap out of memory内存溢出问题求助

Angular集成CKEditor5时出现Heap out of memory内存溢出问题求助

大家好,我在Angular项目里集成CKEditor5的时候碰到了棘手的内存溢出问题,想请教下各位大佬这是什么原因导致的,以及有没有解决办法:

我的操作步骤

  • 执行依赖安装命令:npm install --save @ckeditor/ckeditor5-angular
  • 在shared.module.ts中导入CKEditor模块:
    import { CKEditorModule } from '@ckeditor/ckeditor5-angular';
    

出现的问题

运行ng serve之后,编译虽然提示成功,但在生成浏览器应用包的sealing阶段突然卡住,同时我的RAM占用比平时飙升了4G多,接着就出现了内存溢出相关的GC日志:

√ Compiled successfully.
⠦ Generating browser application bundles (phase: sealing)...

<--- Last few GCs --->

[4380:0000018D91386A30]   635576 ms: Scavenge (reduce) 3769.1 (4135.9) -> 3769.1 (4135.9) MB, 3.8 / 0.0 ms  (average mu = 0.069, current mu = 0.027) allocation failure;
[4380:0000018D91386A30]   635584 ms: Scavenge (reduce) 3771.8 (4138.6) -> 3771.8 (4138.6) MB, 3.8 / 0.0 ms  (average mu = 0.069, current mu = 0.027) allocation failure;
[4380:0000018D91386A30]   635589 ms: Scavenge (reduce) 3772.9 (4139.7) -> 3772.9 (4139.7) MB, 3.6 / 0.0 ms  (...

已尝试的解决方法

我已经试过删除node_modules文件夹和package-lock.json文件,然后重新安装依赖,但问题依然存在。

有没有大佬能帮忙分析下这个错误的原因呀?


备注:内容来源于stack exchange,提问作者adam nikk

相关产品推荐
方舟 Agent Plan

超全模态模型 × Harness 升级,最新支持 Deepseek-V4.1-Flash、GLM-5.3 系列、Doubao-Seedream-5.0-pro、Kimi-K3 (部分), 限时 9.9 元起

最近更新时间:2026.04.15 14:59:52