0
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

More than 3 years have passed since last update.

GCP Cloud Build で `FATAL ERROR: Ineffective mark-compacts near heap limit Allocation failed - JavaScript heap out of memory`

Last updated at Posted at 2021-03-16

ヒープ領域が限界に近くて割り当てに失敗したらしい

Cloud Build で使われていたマシン

解決策

  • NODE_OPTIONS=--max-old-space-size=xxx
    • xxxにメガバイト単位の数字を指定。 筆者は3072と指定した
  • --max-old-space-size=xxx
    • https://nodejs.org/docs/latest-v12.x/api/cli.html#cli_node_options_options
    • ヒープの Old 領域をメガバイト単位で指定してあげる
    • 注意として,ここで指定するのは Old 領域なのでNode.jsに実際に割り当てられるメモリサイズ==指定サイズ とはならない
      • 指定サイズに New 領域を加算した値が実際に Node.js に割り当てられるメモリサイズになる

参考

0
0
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
0
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?