rails: Memory leak in development
Steps to reproduce
Add lines to ApplicationController
:
after_action do
logger.info 'Leaked: ' +
view_paths.first.instance_variable_get(:@cache).instance_variable_get(:@data).size.to_s
end
Refresh page few times. See the number is increasing.
It’s related to #20384. Digests are cleared, but not cache objects. I haven’t found easy way to clear all caches, as every controller seems to have its own.
Expected behavior
Cache size should not be incremented infinitely.
Actual behavior
It’s incremented infinitely.
System configuration
Rails version: 5.0.0.1
Ruby version: 2.3
About this issue
- Original URL
- State: open
- Created 8 years ago
- Reactions: 1
- Comments: 16 (15 by maintainers)
Yes, I think this is the same issue. #27296 still wasn’t merged.