views:

34

answers:

1

I have a Ruby application that uses eventmachine and starts 16 processes that each manage 1000 connections. Initially each process only uses around 150MB, however after some runtime they consume more and more towards 500MB and I am running out of memory and swap. The amount of open connections (indicated by EM.connection_count) is normal (around 1000 all the time), so there shouldn't really be references to old connections anymore.

Unfortunately, memprof only runs under Ruby 1.8, so this is not an option in my case.

I don't want to build the ITAPPMONROBOT for my application just so I can keep it running 24/7/365. How can I find the memory leak here or how can I help the GC?

A: 

There is a known memory leak in 1.9.2's Kernel#method that affects most EM applications. See http://groups.google.com/group/eventmachine/browse_thread/thread/fa56ff02440a624d and http://redmine.ruby-lang.org/issues/show/3466#note-3

tmm1