LoginSignup
1
3

More than 3 years have passed since last update.

Cannot allocate memory - fork(2) 対策

Posted at

自動デプロイでエラー。unicornでエラーしていたので備忘録として書きます。
解釈がおかしければご指摘ください。

unicorn.stderr.log
(省略)Cannot allocate memory - fork(2)

上記の意味はメモリエラーです。
メモリが足りない時にされていることとしてメモリースワップがありますが・・・
AWS EC2 Linux は設定されていません。
(コマンド$ free で表示されますが、初期ではswapのところは0になってます)

設定の仕方は以下のページを参考にしました。先駆者様本当にありがとうございます。
【Linux】スワップ領域(ファイル)の作り方

※ $ mkswap /Swapfile の際に時間がかかるのでご注意ください
上記ページの処理をすれば1GBのスワップ領域が確保されます。

1
3
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
1
3