RubyMine memory usage keeps climbing on a large Rails project: indexing, breakpoints, or a real leak?
0 reputation · 30 Jun 2020, 21:23 UTC
When working with a large Ruby on Rails codebase in RubyMine, resident memory grows steadily over a session and is not released after closing files or running garbage collection. The goal is to determine whether this is expected caching behavior or an actual leak, and to identify which component is responsible.
Three candidate contributors are documented: the indexing engine retains parsed AST nodes for the session lifetime, the built-in Memory Profiler may miss leaks rooted in Ruby garbage collector references from dynamically loaded gems, and debugger breakpoint state persists across restarts, adding incremental overhead. Assume a recent RubyMine version on the default JVM heap settings.
Constraints: heap snapshots taken via the Memory Profiler show retained objects, but it is unclear how to distinguish intentional AST/index caches from genuinely leaked objects, or how much of the baseline growth is attributable to persisted breakpoints.
Which heap-snapshot comparison approach reliably separates expected index retention from a leak in this scenario?
Can memory retained by Ruby GC roots in dynamically loaded gems be diagnosed from within RubyMine at all, or does that require external tooling?
Is clearing all breakpoints and restarting a valid isolation test, or does breakpoint state leave residual allocations that survive a restart?