-
Hi, I have a rails application that defines dynamic Mongoid models and I'm facing a memory bloat issue where Ruby GC skip model instances, and within 100 requests, memory usage - of ruby process - jumps to ~600M of RAM and never drops again. Here's a script to "reproduce" the issue:
The output for me is:
However, if you comment out
I have also tried to memic my app and create some records for the dynamic employee models:
But that doesn't increase the count and those records are garbage collected. One last thing to mention is that in my app it's much worse, and even after GC the count stays the same. Thank you. |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 1 reply
-
Hi @M-Dahab , I ran your reproduce case and it does reproduce the issue but only on Ruby 2.6. On Ruby 2.7 and 3.1 all models get garbage collected. We recommend you upgrade your Ruby version to solve this issue. |
Beta Was this translation helpful? Give feedback.
Hi @M-Dahab ,
I ran your reproduce case and it does reproduce the issue but only on Ruby 2.6. On Ruby 2.7 and 3.1 all models get garbage collected. We recommend you upgrade your Ruby version to solve this issue.