I am using sidekiq gem to move my heavy reporting jobs to background. The problem is that sidekiq does not release memory even after a job is completed and it is causing an ever increasing memory bloat as mentioned in sidekiq troubleshooting, resulting in sidekiq restart after every 4-5 jobs. I have tried ActiveRecord::Base.uncached and even tried this in my application.rb - config.middleware.delete "ActiveRecord::QueryCache"
but still no use. Even GC.start is not working. How do I clear memory after every job?
Asked
Active
Viewed 627 times
2

Umesh Malhotra
- 967
- 1
- 10
- 25
-
I think we need to see more code. Can you provide an example of your worker, of the cache you want to free and it is not, and more details on what you tried. – dgilperez Aug 19 '18 at 10:44
-
1https://stackoverflow.com/a/20392555/3011280 this will give you a clue – Oshan Wisumperuma Jan 16 '19 at 08:26