环境: ARM64

  1. <--- Last few GCs --->
  2. <--- JS stacktrace --->
  3. #
  4. # Fatal process OOM in insufficient memory to create an Isolate
  5. #

在Dockerfile上设置max-old-space-size的node.js启动参数, 亲测有效。

  1. CMD node --report-on-fatalerror --max-old-space-size=1536 dist/index.js

Currently, by default v8 has a memory limit of 512mb on 32-bit and 1gb on 64-bit systems. You can raise the limit by setting —max-old-space-size to a maximum of ~1gb for 32-bit and ~1.7gb for 64-bit systems. But it is recommended to split your single process into several workers if you are hitting memory limits.

参考