[Backgroundrb-devel] deleting a worker

simon.wilkinson at 434wireless.com simon.wilkinson at 434wireless.com
Fri Apr 13 11:49:17 EDT 2007


Hi,

I have workers being created from within my main rails app when it receives XML documents.  These workers then parse the XML and store the data that it contains.  I would like the worker to delete itself at the end of its do_work method, so that the main rails app does not need to keep track of all the generated workers.

I currently have the following lines at the end of the do_work method:

ActiveRecord::Base.connection.disconnect!
self.delete

When I track usage, I see that the number of tasks that are running is equal to the number of workers, and that they disappear when the worker finishes it's parsing.  However, I also noticed that the amount of memory used goes up every time a worker is created.  At first it goes up by a lot, and then after the task completes the memory drops back down again, but remains higher than it was before the worker was created.  This value doesn't seem to reduce at all over longer periods of inactivity.  

Is this a result of how I am deleting the worker, or are there known memory issues with using BackgrounDRb, or is there another step that I am missing to accomplish this?  Any help would be appreciated.

Thanks,

Simon


More information about the Backgroundrb-devel mailing list