[Backgroundrb-devel] Cutting down BackgrounDRb memory issue

Ryan Leavengood leavengood at gmail.com
Fri Apr 11 20:54:59 EDT 2008

On Fri, Apr 11, 2008 at 8:22 PM, hemant kumar <gethemant at gmail.com> wrote:
>  A classic solution is to use fork and exec, rather than just fork. Its
>  working and pretty stable, but you loose ability to pass complex
>  arguments when invoking MiddleMan.new_worker, because essentially I can
>  only pass arguments in form of strings when using exec.

Is that really a problem?

irb(main):001:0> a = [{:key=>'value','another one'=>'something'}, 3,
56, "foobar"]
=> [{"another one"=>"something", :key=>"value"}, 3, 56, "foobar"]
irb(main):002:0> s = Marshal.dump(a)
=> "\004\b[\t{\a\"\020another one\"\016something:\bkey\"\nvaluei\bi=\"\vfoobar"
irb(main):003:0> b = Marshal.load(s)
=> [{"another one"=>"something", :key=>"value"}, 3, 56, "foobar"]
irb(main):004:0> a == b
=> true

>  This help significantly in improving stability of BackgrounDRb and code
>  written on top of packet. So what you guys think? Shall we go for this
>  change?

It sounds good to me. Anything that helps stability and improves
memory usage will always get my vote.


More information about the Backgroundrb-devel mailing list