9
1

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 5 years have passed since last update.

Rails 5でconfig.cache_classes = falseにしているとメモリリークする

Last updated at Posted at 2017-06-09

環境

  • Rails 5.1.1
  • Ruby 2.3.0p0

Rails 4.2.6ではこの問題は発生しなかった。

cache_classes とは

config.cache_classes = false    # falseのとき、ソースに変更を加えると次回リクエスト処理時に変更が反映される(ソースがリロードされる)
config.cache_classes = true     # trueのとき、反映されない。

# developmentでのデフォルトはfalse
# productionでのデフォルトはtrue

問題

config.cache_classes = falseにしているとリクエストの度にRubyプロセスの使用メモリが際限なく増え続ける。

おそらくこのissueが関連している:
Memory leak in development · Issue #27273 · rails/rails
Fix memory leak in action view by printercu · Pull Request #27296 · rails/rails

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

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?