Thread View: borland.public.cppbuilder.webservices.soap
9 messages
9 total messages
Started by m.durliNOSPAM
Fri, 05 Oct 2007 13:43
Leak in HTTPRio? in TOMCAT? No more Internet handles can be allocated
Author: m.durliNOSPAM
Date: Fri, 05 Oct 2007 13:43
Date: Fri, 05 Oct 2007 13:43
30 lines
2087 bytes
2087 bytes
Hello,
sorry for crossposting but I think it involves all the 3 groups.
I have a server application that communicate with many clients via
TCP/IP sockets.
void __fastcall TForm1::IdTCPServer1Execute(TIdPeerThread *AThread)
each TCPServer1Execute thread launched by a request from a client
generates a call to an external webservice with this procedure:
THTTPRIO* iRio = new THTTPRIO(this);
iRio->URL = "urlname";
_di_Server iService;
iRio->QueryInterface(iService);
Response=iService->serviceName(XMLDocument->XML->Text);
iService = NULL;
It works perfectly for days, then suddendly it crashes every
webservice call with a:
"No more Internet handles can be allocated - URL:urlname -
SOAPAction:"""
where urlname is the same valid URL I use in the program.
The web service server is TOMCAT, and the same happens on different
servers where the two applications are installed.
Do you have any idea of why this is happening?
Thanks!
Matt
Re: Leak in HTTPRio? in TOMCAT? No more Internet handles can be allocated
Author: Remy Lebeau (TeamB)
Date: Fri, 05 Oct 2007 16:54
Date: Fri, 05 Oct 2007 16:54
20 lines
1771 bytes
1771 bytes
<m.durliNOSPAM@bo.nettuno.it> wrote in message
news:c1fcg3tprri33t0o5fhc95k11c9j91mv4h@4ax.com...
> THTTPRIO* iRio = new THTTPRIO(this);
Are you ever deleting that object after sending a request?
Assuming 'this' is the pointer to your TForm1 instance, I do not suggest
using the TForm as the Owner for the object. TIdTCPServer is a
multi-threaded component, and the TForm's Components array is not
thread-safe. Use a NULL Owner and 'delete' the object when you are done
with it, ie:
THTTPRIO* iRio = new THTTPRIO(NULL);
//...
delete iRio;
Gambit
Re: Leak in HTTPRio? in TOMCAT? No more Internet handles can be allocated
Author: m.durliNOSPAM
Date: Mon, 08 Oct 2007 08:53
Date: Mon, 08 Oct 2007 08:53
37 lines
2043 bytes
2043 bytes
Hello,
if I delete the iRio, I receive an AccessViolation error.
I changed the 'this' to 'NULL' anyway, but I still don't know if
that's was the problem because it normally occurs after some days.
THTTPRIO* iRio = new THTTPRIO(NULL);
//...
delete iRio;
Do you have any idea why I receive this AccessViolation?
Thanks,
Mattia
>
><m.durliNOSPAM@bo.nettuno.it> wrote in message
>news:c1fcg3tprri33t0o5fhc95k11c9j91mv4h@4ax.com...
>
>> THTTPRIO* iRio = new THTTPRIO(this);
>
>Are you ever deleting that object after sending a request?
>
>Assuming 'this' is the pointer to your TForm1 instance, I do not suggest
>using the TForm as the Owner for the object. TIdTCPServer is a
>multi-threaded component, and the TForm's Components array is not
>thread-safe. Use a NULL Owner and 'delete' the object when you are done
>with it, ie:
>
> THTTPRIO* iRio = new THTTPRIO(NULL);
> //...
> delete iRio;
>
>
>Gambit
>
Re: Leak in HTTPRio? in TOMCAT? No more Internet handles can be allocated
Author: Jean-Marie Babet
Date: Thu, 11 Oct 2007 23:20
Date: Thu, 11 Oct 2007 23:20
28 lines
1947 bytes
1947 bytes
Hello Mattia, > if I delete the iRio, I receive an AccessViolation error. The most common reason why deleting a RIO causes an AV is if it was created with (NULL). When you create a RIO object with NULL, its lifetime will be managed via the refcount of the interface it hands out. So you do *NOT* want to call delete on the object explicitly. You simply want to release the interface it handed out. To illustrate: THTTPRIO* iRIO = new THTTPRIO(NULL); __di_someInterface service; iRIO->QueryInterface(service); service.Release(); // < (**) The call to 'service.Release()' will cleanup the iRIO instance (provided no one else is holding on to references to 'service'). Let me know if the above does not help! Cheers, Bruneau.
Re: Leak in HTTPRio? in TOMCAT? No more Internet handles can be allocated
Author: m.durliNOSPAM
Date: Mon, 15 Oct 2007 15:18
Date: Mon, 15 Oct 2007 15:18
36 lines
1969 bytes
1969 bytes
Hello Jean Marie, > service.Release(); // < (**) previous than deleting iRio, and following some other samples, I used: service = NULL; that doesn't give the AV and works, but as reported earlier, after some time (can be just some days or weeks) suddendly it crashes every webservice call with a: "No more Internet handles can be allocated - URL:urlname - SOAPAction:""" I'll change service=NULL to service.Release(); as per you reccomendation, but do you think it will behave differently in the long time? (I mean: do you think that using the NULL assignment was wrong and was the cause of the "No more internet handles...") Thank you very much! Mattia > > > >The call to 'service.Release()' will cleanup the iRIO instance (provided no >one else is holding on to references to 'service'). > >Let me know if the above does not help! > >Cheers, > >Bruneau. >
Re: Leak in HTTPRio? in TOMCAT? No more Internet handles can be allocated
Author: Jean-Marie Babet
Date: Mon, 15 Oct 2007 19:01
Date: Mon, 15 Oct 2007 19:01
12 lines
1630 bytes
1630 bytes
Hello, Invoking Release() or assigning NULL to a DelphiInterface<T> should have the same effect: i.e. invoke 'Release' on the underlying interface. What version of Delphi do you have? I don't recall any particular issue in that area but it's possible that maybe the version of the runtime you're using had a leak of interface handles. Cheers, Bruneau.
Re: Leak in HTTPRio? in TOMCAT? No more Internet handles can be allocated
Author: m.durliNOSPAM
Date: Mon, 15 Oct 2007 22:31
Date: Mon, 15 Oct 2007 22:31
29 lines
2177 bytes
2177 bytes
Hello, not Delphi, I'm using CBuilder 6. Actually, looking for "httprio leak" in google I found some references to a similar problem (many users are experiencing a memory leak using the component) but I couldn't find a way to solve it. And I don't know if I'm having the same problem (I notice the memory leak using the memproof program), but I don't know if the same memory leak is responsible of the strange error message I receive: "No more Internet handles can be allocated - URL:urlname - SOAPAction:""" Thanks, Mattia >Hello, > >Invoking Release() or assigning NULL to a DelphiInterface<T> should have the >same effect: i.e. invoke 'Release' on the underlying interface. > >What version of Delphi do you have? I don't recall any particular issue in >that area but it's possible that maybe the version of the runtime you're >using had a leak of interface handles. > >Cheers, > >Bruneau. >
Re: Leak in HTTPRio? in TOMCAT? No more Internet handles can be allocated
Author: Jean-Marie Babet
Date: Tue, 16 Oct 2007 17:00
Date: Tue, 16 Oct 2007 17:00
13 lines
1709 bytes
1709 bytes
Hello, > not Delphi, I'm using CBuilder 6. OK! Yes, if it's CBuilder6 you're probably running into a runtime bug that has been addressed. Unfortunately, it's not that easy to merge the current runtime to the v6.0 version. Let me see if I can find any change that would be relevant to this issue. If time allows, can you email me a copy of the SOAPHTTPTrans.pas file from your copy of CBuilder6. Cheers, Bruneau.
Re: Leak in HTTPRio? in TOMCAT? No more Internet handles can be allocated
Author: m.durliNOSPAM
Date: Wed, 17 Oct 2007 09:42
Date: Wed, 17 Oct 2007 09:42
6 lines
1510 bytes
1510 bytes
> >OK! Yes, if it's CBuilder6 you're probably running into a runtime bug that Oh great, I just sent the files to your email. Thank you very much for your help. Mattia
Thread Navigation
This is a paginated view of messages in the thread with full content displayed inline.
Messages are displayed in chronological order, with the original post highlighted in green.
Use pagination controls to navigate through all messages in large threads.
Back to All Threads