Helpers use large memory in rails 3 (.2)

During the migration of the rails 2 application to rails 3, I encountered a huge increase in memory usage. After some research, I found out that assistants were a problem. Exposing any helpers in the view will speed everything up.

Things I was trying to find in a real problem:

  • include_all_helpers = false
  • disable parts of auxiliary files
  • clear code by refactoring Model.all uses faster code

Now I have the theory that some helpers can be renamed or deleted, the rails begin to search for them and begin to search for models / controllers as a salvation.

A page request takes up to 5 seconds and uses 2 GB of memory.

Has anyone understood what is causing this problem, and how to fix or debug it?

+4
source share
1 answer

Fixed by placing this in config / initializers / anti_freeze_hack.rb:

module ActionDispatch module Routing class RouteSet alias inspect to_s end end end 

Amala loans for a link to a suitable topic: D

+1
source

Source: https://habr.com/ru/post/1395735/


All Articles