toptal / chewy

High-level Elasticsearch Ruby framework based on the official elasticsearch-ruby client
MIT License
1.88k stars 366 forks source link

Fix memory leak for ruby 3.2 #882

Closed konalegi closed 1 year ago

konalegi commented 1 year ago

After switching to Ruby 3.2 we started to get a memory leak. I don't have any explanation for why it so, it looks like something significant has changed in ruby 3.2 in terms of sigleton_class.eval.

Ruby 3.2 (without fix) (green line) vs ruby 3.0 (orange line) memory consumption graphs image

after the fix has been applied image


Before submitting the PR make sure the following are checked: