1

我正在尝试追踪我的 Rails 应用程序中的内存泄漏。我知道使用 reflect_on_all_associations 有点慢,但是有没有人发现这会导致 Rails 应用程序中的内存泄漏?我正在使用 3.2.6。通常在生产应用程序中使用 reflect_on_all_associations 是否令人不悦?

就像是:

Event.reflect_on_all_associations.map{|mac| mac.class_name if mac.macro==:belongs_to}.compact
Event.reflect_on_all_associations.map{|mac| mac.class_name if mac.macro==:has_many}.compact

谢谢!

4

0 回答 0