Has anyone had any experience with making calls to Win32 COM object in a rails controller. I have no problem making the calls using the WIN32 module, however I do seem to have some memory leaks, when the COM object being called at some point makes use of SafeArrays. The same method calls in VB,Visual C++ don''t produce the same memory leaks. I realize this might seem a little odd, but I''ve been instructed to evaluate rails for a project that still makes use of existing in-house COM objects already developed. Thanks, John
> > Date: Wed, 21 Sep 2005 07:57:47 -0400 > From: John Cole <cole-4EMvX6ScFxe/3pe1ocb+swC/G2K4zDHf@public.gmane.org> > > Has anyone had any experience with making calls to Win32 COM object in a > rails controller. I have no problem making the calls using the WIN32 > module, however I do seem to have some memory leaks, when the COM object > being called at some point makes use of SafeArrays. The same method > calls in VB,Visual C++ don''t produce the same memory leaks. I realize > this might seem a little odd, but I''ve been instructed to evaluate rails > for a project that still makes use of existing in-house COM objects > already developed.I could be in the same spot soon actually. I''ve got a back-burner project that I want to do in RoR tying into COM, so I am curious as to the responses to your post. I also will need to call Java somehow through Ruby (JRuby is not an option). Now you mention that the memory leak doesn''t occur in VB/VC++ calling the COM object. Have you considered just wrapping those COM objects with a SOAP API and having RoR call that with it''s web services library? Let VB instantiate the COM object and deal with it. Microsoft has a pretty decent SOAP API Toolkit for VB 6 that also works with VC++. Of course, this adds the overhead of SOAP, and degrades performance than direct COM calls - but it might be something to look at. _______________________________________________ Rails mailing list Rails-1W37MKcQCpIf0INCOvqR/iCwEArCW2h5@public.gmane.org http://lists.rubyonrails.org/mailman/listinfo/rails
CLung wrote:> Date: Wed, 21 Sep 2005 07:57:47 -0400 > From: John Cole < cole-4EMvX6ScFxe/3pe1ocb+swC/G2K4zDHf@public.gmane.org > <mailto:cole-4EMvX6ScFxe/3pe1ocb+swC/G2K4zDHf@public.gmane.org>> > > Has anyone had any experience with making calls to Win32 COM > object in a > rails controller. I have no problem making the calls using the WIN32 > module, however I do seem to have some memory leaks, when the COM > object > being called at some point makes use of SafeArrays. The same method > calls in VB,Visual C++ don''t produce the same memory leaks. I realize > this might seem a little odd, but I''ve been instructed to evaluate > rails > for a project that still makes use of existing in-house COM objects > already developed. > > > I could be in the same spot soon actually. I''ve got a back-burner > project that I want to do in RoR tying into COM, so I am curious as to > the responses to your post. I also will need to call Java somehow > through Ruby (JRuby is not an option). > > Now you mention that the memory leak doesn''t occur in VB/VC++ calling > the COM object. Have you considered just wrapping those COM objects > with a SOAP API and having RoR call that with it''s web services > library? Let VB instantiate the COM object and deal with it. > Microsoft has a pretty decent SOAP API Toolkit for VB 6 that also > works with VC++. Of course, this adds the overhead of SOAP, and > degrades performance than direct COM calls - but it might be something > to look at. > > >------------------------------------------------------------------------ > >_______________________________________________ >Rails mailing list >Rails-1W37MKcQCpIf0INCOvqR/iCwEArCW2h5@public.gmane.org >http://lists.rubyonrails.org/mailman/listinfo/rails > > >------------------------------------------------------------------------ > >Internal Virus Database is out-of-date. >Checked by AVG Anti-Virus. >Version: 7.0.344 / Virus Database: 267.10.17/84 - Release Date: 8/29/2005 > >Ok more info after some further testing. The problem appears to be somehow linked to WEBrick and Apache using fcgi. The memory leaks only appear when running under WEBrick and Apache with fcgi. Apache 2.0.54 and 1.3.33 with just regular .cgi handler works fine (performance sucks though). I guess the next thing to try would be the SCGI Rails runner. However the rails runner site is missing details for windows installs and only says that Curt Hibbs has successfully got it running in Apache 2.0.54 on windows. -- John Cole Computer Programmer Keigan Systems Inc. Web: http://www.keigansystems.com Email: cole-4EMvX6ScFxe/3pe1ocb+swC/G2K4zDHf@public.gmane.org Phone: (519)433-0077 ext. 2437
I sent Zed Shaw my builds of mod_scgi.so for both apache1 and apache2 along with instructions for setting it up in httpd.conf. He should have all of that online soon. Curt On 9/21/05, John Cole <cole-4EMvX6ScFxe/3pe1ocb+swC/G2K4zDHf@public.gmane.org> wrote:> CLung wrote: > > > Date: Wed, 21 Sep 2005 07:57:47 -0400 > > From: John Cole < cole-4EMvX6ScFxe/3pe1ocb+swC/G2K4zDHf@public.gmane.org > > <mailto:cole-4EMvX6ScFxe/3pe1ocb+swC/G2K4zDHf@public.gmane.org>> > > > > Has anyone had any experience with making calls to Win32 COM > > object in a > > rails controller. I have no problem making the calls using the WIN32 > > module, however I do seem to have some memory leaks, when the COM > > object > > being called at some point makes use of SafeArrays. The same method > > calls in VB,Visual C++ don''t produce the same memory leaks. I realize > > this might seem a little odd, but I''ve been instructed to evaluate > > rails > > for a project that still makes use of existing in-house COM objects > > already developed. > > > > > > I could be in the same spot soon actually. I''ve got a back-burner > > project that I want to do in RoR tying into COM, so I am curious as to > > the responses to your post. I also will need to call Java somehow > > through Ruby (JRuby is not an option). > > > > Now you mention that the memory leak doesn''t occur in VB/VC++ calling > > the COM object. Have you considered just wrapping those COM objects > > with a SOAP API and having RoR call that with it''s web services > > library? Let VB instantiate the COM object and deal with it. > > Microsoft has a pretty decent SOAP API Toolkit for VB 6 that also > > works with VC++. Of course, this adds the overhead of SOAP, and > > degrades performance than direct COM calls - but it might be something > > to look at. > > > > > >------------------------------------------------------------------------ > > > >_______________________________________________ > >Rails mailing list > >Rails-1W37MKcQCpIf0INCOvqR/iCwEArCW2h5@public.gmane.org > >http://lists.rubyonrails.org/mailman/listinfo/rails > > > > > >------------------------------------------------------------------------ > > > >Internal Virus Database is out-of-date. > >Checked by AVG Anti-Virus. > >Version: 7.0.344 / Virus Database: 267.10.17/84 - Release Date: 8/29/2005 > > > > > Ok more info after some further testing. The problem appears to be > somehow linked to WEBrick and Apache using fcgi. > > The memory leaks only appear when running under WEBrick and Apache with > fcgi. Apache 2.0.54 and 1.3.33 with just regular .cgi handler works fine > (performance sucks though). I guess the next thing to try would be the > SCGI Rails runner. However the rails runner site is missing details for > windows installs and only says that Curt Hibbs has successfully got it > running in Apache 2.0.54 on windows. > > -- > John Cole > Computer Programmer > Keigan Systems Inc. > Web: http://www.keigansystems.com > Email: cole-4EMvX6ScFxe/3pe1ocb+swC/G2K4zDHf@public.gmane.org > Phone: (519)433-0077 ext. 2437 > > _______________________________________________ > Rails mailing list > Rails-1W37MKcQCpIf0INCOvqR/iCwEArCW2h5@public.gmane.org > http://lists.rubyonrails.org/mailman/listinfo/rails >
John Cole wrote:> Ok more info after some further testing. The problem appears to be > somehow linked to WEBrick and Apache using fcgi. > > The memory leaks only appear when running under WEBrick and Apache with > fcgi. Apache 2.0.54 and 1.3.33 with just regular .cgi handler works fine > (performance sucks though). I guess the next thing to try would be the > SCGI Rails runner. However the rails runner site is missing details for > windows installs and only says that Curt Hibbs has successfully got it > running in Apache 2.0.54 on windows.Normal CGI would not suffer badly in the face of a memory leak, as all memory used by a request is freed when the CGI process terminates. Performance is poor with Rails because each request spawns a new CGI process, and Rails has a high start-up cost. If the problem lies with Ruby''s handling of COM, then WEBrick, FastCGI and SCGI will all suffer in the same way. regards Justin