[Backgroundrb-devel] worker process hanging around, spiking memory

Clint Troxel clint at ctro.net
Wed Feb 27 18:26:39 EST 2008

Hi. Posted a general question earlier today.  I have a specific
question this time -- hoping someone can help out.  I think I'm
probably doing something incorrectly.  Here goes:

I have a Worker method that sends a lot of emails.  The method looks like this:

def send_participant_reminders(args=nil)
    args[:emails].each do |email|

      unless email.notified?


I call that worker from a controller like so:

    MiddleMan.new_worker(:worker => :participant_worker)
    MiddleMan.ask_work(:worker => :participant_worker,
      :worker_method => :send_participant_reminders,
      :data => {:emails => @emails})


My emails are being sent, but I'm seeing a new process created *each
time I invoke the code in the controller*.  That process starts out at
about 17m of memory then, once all work appears to have been
completed, jumps to about 50m.  The process stays around until
"script/backgroundrb stop".

Maybe I've been reading the examples incorrectly?

Any help would be appreciated.  Seeing this same problem (I think)
suck up 4G of ram on a production server.  yuck.

Thanks again,

More information about the Backgroundrb-devel mailing list