Re: [twsocket] Memory leaks...
Hi, The TWSocket is on a TDataModule. I am creating the TDataModule and yes I am freeing it. If I was not freeing the TDataModule it would be reported as a leak, along with the other items on the TDataModule. I have not made a test case that just has a TDataModule with a TWSocket. Are you using AQTime? Thanks for the response, Mark -Original Message- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf Of DZ-Jay Sent: Monday, January 07, 2008 10:53 AM To: ICS support mailing Subject: Re: [twsocket] Memory leaks... On Jan 7, 2008, at 11:45, zayin wrote: I located the archive and I see his response. The leak is reported at program termination not during normal execution. Are you creating the class object yourself, and if so, are you sure it is being destroyed? Can you offer some code? dZ. P.S. Do not send a new question as a reply to a message with a different topic -- always start a new topic. Most mail programs will thread the messages by ID and they may not be visible to some users. For example, your past messages seem to have come in as replies to the smtp component not ready thread. -- DZ-Jay [TeamICS] http://www.overbyte.be/eng/overbyte/teamics.html -- To unsubscribe or change your settings for TWSocket mailing list please goto http://lists.elists.org/cgi-bin/mailman/listinfo/twsocket Visit our website at http://www.overbyte.be -- To unsubscribe or change your settings for TWSocket mailing list please goto http://lists.elists.org/cgi-bin/mailman/listinfo/twsocket Visit our website at http://www.overbyte.be
Re: [twsocket] Memory leaks...
Hello, Sorry for the trouble. I just fixed an error in another part of the program, a call to a driver, having nothing to do with the TWSocket or really anything related to it, and AQTime reports only one leak of 4096 bytes. This one I have no idea what it is. It appears to be from MakeObjectInstance on TApplication.Create. I just switched from SleuthQA to AQtime. AQtime seems pretty good so far. There are many more features and the learning curve is OK. Thanks for all your patience. Ciao, Mark -Original Message- From: zayin [mailto:[EMAIL PROTECTED] Sent: Monday, January 07, 2008 11:10 AM To: 'ICS support mailing' Subject: RE: [twsocket] Memory leaks... Hi, The TWSocket is on a TDataModule. I am creating the TDataModule and yes I am freeing it. If I was not freeing the TDataModule it would be reported as a leak, along with the other items on the TDataModule. I have not made a test case that just has a TDataModule with a TWSocket. Are you using AQTime? Thanks for the response, Mark -Original Message- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf Of DZ-Jay Sent: Monday, January 07, 2008 10:53 AM To: ICS support mailing Subject: Re: [twsocket] Memory leaks... On Jan 7, 2008, at 11:45, zayin wrote: I located the archive and I see his response. The leak is reported at program termination not during normal execution. Are you creating the class object yourself, and if so, are you sure it is being destroyed? Can you offer some code? dZ. P.S. Do not send a new question as a reply to a message with a different topic -- always start a new topic. Most mail programs will thread the messages by ID and they may not be visible to some users. For example, your past messages seem to have come in as replies to the smtp component not ready thread. -- DZ-Jay [TeamICS] http://www.overbyte.be/eng/overbyte/teamics.html -- To unsubscribe or change your settings for TWSocket mailing list please goto http://lists.elists.org/cgi-bin/mailman/listinfo/twsocket Visit our website at http://www.overbyte.be -- To unsubscribe or change your settings for TWSocket mailing list please goto http://lists.elists.org/cgi-bin/mailman/listinfo/twsocket Visit our website at http://www.overbyte.be
Re: [twsocket] Memory leaks...
Hello Mark, When you call connect the function returns immediatily, but the connection happens in background. So it is normal there is memory allocated. Needed memory is not nececarely a leak. --- Rgds, Wilfried [TeamICS] http://www.overbyte.be/eng/overbyte/teamics.html http://www.mestdagh.biz Sunday, January 6, 2008, 05:19, zayin wrote: Hello, tcpPort: TWSocket; tcpPort.Connect AQTime is reporting a memory leak after I call connect. Has anyone run into this issue? D2007 SP3 XP Pro SP3 5.25 is in the WSocket file. Ciao, Mark -- To unsubscribe or change your settings for TWSocket mailing list please goto http://lists.elists.org/cgi-bin/mailman/listinfo/twsocket Visit our website at http://www.overbyte.be
Re: [twsocket] Memory leaks
If the stream behaviour is what you need, I don't see any problem with that. What about memory allocation ? Paul PS: for all who's concerned about memory leaks : I've asked Pierre le Riche (author of FastMM) about memory consumption. The only thing you need to check is the virtual memory. It's not the standard configuration in the taskmanager, so you need to enable it first -- To unsubscribe or change your settings for TWSocket mailing list please goto http://www.elists.org/mailman/listinfo/twsocket Visit our website at http://www.overbyte.be
Re: [twsocket] Memory leaks
If the stream behaviour is what you need, I don't see any problem with that. What about memory allocation ? It is better to keep the object created of course. But this doesn't change anything regarding to what the object optimize the memory it may have allocated. Contribute to the SSL Effort. Visit http://www.overbyte.be/eng/ssl.html -- [EMAIL PROTECTED] Author of ICS (Internet Component Suite, freeware) Author of MidWare (Multi-tier framework, freeware) http://www.overbyte.be -- To unsubscribe or change your settings for TWSocket mailing list please goto http://www.elists.org/mailman/listinfo/twsocket Visit our website at http://www.overbyte.be
Re: [twsocket] Memory leaks
If FastMM doesn't report any leak, then the increase probably result from memory fragmentation. I think FastMM solved the memory-fragmention-problem of the old Delphi memory manager. That's at least my expierence in applications where GetMem/FreeMem is called frequently (several thousands calls per second). FastMM has a much better behaviour than the standard memory allocator prior to D2006. But this doesn't eliminate fragmentation completely. Contribute to the SSL Effort. Visit http://www.overbyte.be/eng/ssl.html -- [EMAIL PROTECTED] Author of ICS (Internet Component Suite, freeware) Author of MidWare (Multi-tier framework, freeware) http://www.overbyte.be -- To unsubscribe or change your settings for TWSocket mailing list please goto http://www.elists.org/mailman/listinfo/twsocket Visit our website at http://www.overbyte.be
Re: [twsocket] Memory leaks
I see no difference between http and https. so SSL has nothing to do with it Paul - Original Message - From: Arno Garrels [EMAIL PROTECTED] To: ICS support mailing twsocket@elists.org Sent: Sunday, October 08, 2006 8:40 PM Subject: Re: [twsocket] Memory leaks Paul wrote: Hi, When my program is running (sending a stream about each second with SslHttpCli), I see the memory useage in the taskmanager increasing continuous. May be cached SSL sessions are the reason? --- Arno Garrels [TeamICS] http://www.overbyte.be/eng/overbyte/teamics.html The SslHttpCli is running in a seperate thread. FastMM doesn't report any memory leaks, except for a string(20 bytes) AssumeMultiThreaded is enable in FastMM. Anyone seen this before ? PAul -- To unsubscribe or change your settings for TWSocket mailing list please goto http://www.elists.org/mailman/listinfo/twsocket Visit our website at http://www.overbyte.be -- To unsubscribe or change your settings for TWSocket mailing list please goto http://www.elists.org/mailman/listinfo/twsocket Visit our website at http://www.overbyte.be
Re: [twsocket] Memory leaks
I see no difference between http and https. so SSL has nothing to do with it That's a good news. It eliminate the need to investigate for the SSL part. Have a look at your global dynamic variables and dynamic variables assigned to forms which have the same timelife as the program. Contribute to the SSL Effort. Visit http://www.overbyte.be/eng/ssl.html -- [EMAIL PROTECTED] Author of ICS (Internet Component Suite, freeware) Author of MidWare (Multi-tier framework, freeware) http://www.overbyte.be -- To unsubscribe or change your settings for TWSocket mailing list please goto http://www.elists.org/mailman/listinfo/twsocket Visit our website at http://www.overbyte.be
Re: [twsocket] Memory leaks
That's a good news. It eliminate the need to investigate for the SSL part. Have a look at your global dynamic variables and dynamic variables assigned to forms which have the same timelife as the program. Everything is created in runtime. Basically, I created an object that I can use in a program or in a service. It's easier to test it as a program. Streams and bitmaps are created and freed continuously. (5kb to 2Mb) I never tried it before, but maybe it's possible to reuse a stream instead of free + recreate. Paul -- To unsubscribe or change your settings for TWSocket mailing list please goto http://www.elists.org/mailman/listinfo/twsocket Visit our website at http://www.overbyte.be
Re: [twsocket] Memory leaks
That's a good news. It eliminate the need to investigate for the SSL part. Have a look at your global dynamic variables and dynamic variables assigned to forms which have the same timelife as the program. Everything is created in runtime. Basically, I created an object that I can use in a program or in a service. It's easier to test it as a program. Streams and bitmaps are created and freed continuously. (5kb to 2Mb) If I remember well, FatsMM has a function to dump allocated block list. Using it, you could see what is filling the memory after some time and discover your bug. I never tried it before, but maybe it's possible to reuse a stream instead of free + recreate. It is always interesting to reuse objects instead of destroying them and recreate a fresh copy. But speaking about stream, it depends on the type of stream. A TFileStream has to be destroyed to close the file. Contribute to the SSL Effort. Visit http://www.overbyte.be/eng/ssl.html -- [EMAIL PROTECTED] Author of ICS (Internet Component Suite, freeware) Author of MidWare (Multi-tier framework, freeware) http://www.overbyte.be -- To unsubscribe or change your settings for TWSocket mailing list please goto http://www.elists.org/mailman/listinfo/twsocket Visit our website at http://www.overbyte.be
Re: [twsocket] Memory leaks
It is always interesting to reuse objects instead of destroying them and recreate a fresh copy. But speaking about stream, it depends on the type of stream. A TFileStream has to be destroyed to close the file. So as long I'm sending streams with a HttpCli, I don't need to free the stream in the requestdone event and create them int the Get-Post-Put methods ? Just create the streams when the component is created and free when destroying the component? Paul -- To unsubscribe or change your settings for TWSocket mailing list please goto http://www.elists.org/mailman/listinfo/twsocket Visit our website at http://www.overbyte.be
Re: [twsocket] Memory leaks
On 10/9/06, Paul [EMAIL PROTECTED] wrote: It is always interesting to reuse objects instead of destroying them and recreate a fresh copy. But speaking about stream, it depends on the type of stream. A TFileStream has to be destroyed to close the file. I thought about extending HTTPCli and adding a property, CreateMemoryStreams. I use memory streams with HTTPCli and have to do this for every use. It would be nice it the create/free code was already done for me with a simple property setting. -Johnnie Norsworthy -- To unsubscribe or change your settings for TWSocket mailing list please goto http://www.elists.org/mailman/listinfo/twsocket Visit our website at http://www.overbyte.be
Re: [twsocket] Memory leaks
It is always interesting to reuse objects instead of destroying them and recreate a fresh copy. But speaking about stream, it depends on the type of stream. A TFileStream has to be destroyed to close the file. I thought about extending HTTPCli and adding a property, CreateMemoryStreams. I use memory streams with HTTPCli and have to do this for every use. It would be nice it the create/free code was already done for me with a simple property setting. The best way to do that is not to modify the component but derive a new one and add the behaviour you like. -- Contribute to the SSL Effort. Visit http://www.overbyte.be/eng/ssl.html -- [EMAIL PROTECTED] http://www.overbyte.be -- To unsubscribe or change your settings for TWSocket mailing list please goto http://www.elists.org/mailman/listinfo/twsocket Visit our website at http://www.overbyte.be
Re: [twsocket] Memory leaks
On 10/9/06, Francois PIETTE [EMAIL PROTECTED] wrote: I thought about extending HTTPCli and adding a property, CreateMemoryStreams. I use memory streams with HTTPCli and have to do this for every use. It would be nice it the create/free code was already done for me with a simple property setting. The best way to do that is not to modify the component but derive a new one and add the behaviour you like. That's what I am going to do. It's just a handy shortcut for my applications. When you derive a component from an installed component do you have to create packages for design-time installation? It would be nice if I could drop a THHTPCli on a form and then change it to a THTTPCli_DescendantName in code and be able to access the properties I added. -Johnnie Norsworthy -- To unsubscribe or change your settings for TWSocket mailing list please goto http://www.elists.org/mailman/listinfo/twsocket Visit our website at http://www.overbyte.be
Re: [twsocket] Memory leaks
It is always interesting to reuse objects instead of destroying them and recreate a fresh copy. But speaking about stream, it depends on the type of stream. A TFileStream has to be destroyed to close the file. So as long I'm sending streams with a HttpCli, I don't need to free the stream in the requestdone event and create them int the Get-Post-Put methods ? Just create the streams when the component is created and free when destroying the component? If the stream behaviour is what you need, I don't see any problem with that. -- Contribute to the SSL Effort. Visit http://www.overbyte.be/eng/ssl.html -- [EMAIL PROTECTED] http://www.overbyte.be -- To unsubscribe or change your settings for TWSocket mailing list please goto http://www.elists.org/mailman/listinfo/twsocket Visit our website at http://www.overbyte.be
Re: [twsocket] Memory leaks
Paul wrote: Hi, When my program is running (sending a stream about each second with SslHttpCli), I see the memory useage in the taskmanager increasing continuous. The SslHttpCli is running in a seperate thread. FastMM doesn't report any memory leaks, except for a string(20 bytes) AssumeMultiThreaded is enable in FastMM. Anyone seen this before ? Have you run the same application w/o SSL as well? I once tested the SSL stuff with TSslWsocket against a multi-threading SSL TWSocketServer over many hours and several million requests/responses with plenty of concurrent client connections. I couldn't see any obvious memory leak. BTW: Are you using (OverbyteIcs)SslThrdLock.pas which is a Must when running OpenSSL multi-threaded? --- Arno Garrels [TeamICS] http://www.overbyte.be/eng/overbyte/teamics.html PAul -- To unsubscribe or change your settings for TWSocket mailing list please goto http://www.elists.org/mailman/listinfo/twsocket Visit our website at http://www.overbyte.be
Re: [twsocket] Memory leaks
Francois PIETTE wrote: If FastMM doesn't report any leak, then the increase probably result from memory fragmentation. I think FastMM solved the memory-fragmention-problem of the old Delphi memory manager. That's at least my expierence in applications where GetMem/FreeMem is called frequently (several thousands calls per second). --- Arno Garrels [TeamICS] http://www.overbyte.be/eng/overbyte/teamics.html It is also possible that memory allocation are done in global objects (I don't know which one) which a freeed at program exist and nevertheless eat more and more memory. -- Contribute to the SSL Effort. Visit http://www.overbyte.be/eng/ssl.html -- [EMAIL PROTECTED] http://www.overbyte.be - Original Message - From: Paul [EMAIL PROTECTED] To: TWsocket twsocket@elists.org Sent: Sunday, October 08, 2006 4:50 PM Subject: [twsocket] Memory leaks Hi, When my program is running (sending a stream about each second with SslHttpCli), I see the memory useage in the taskmanager increasing continuous. The SslHttpCli is running in a seperate thread. FastMM doesn't report any memory leaks, except for a string(20 bytes) AssumeMultiThreaded is enable in FastMM. Anyone seen this before ? PAul -- To unsubscribe or change your settings for TWSocket mailing list please goto http://www.elists.org/mailman/listinfo/twsocket Visit our website at http://www.overbyte.be -- To unsubscribe or change your settings for TWSocket mailing list please goto http://www.elists.org/mailman/listinfo/twsocket Visit our website at http://www.overbyte.be
Re: [twsocket] Memory leaks
Paul wrote: Hi, When my program is running (sending a stream about each second with SslHttpCli), I see the memory useage in the taskmanager increasing continuous. May be cached SSL sessions are the reason? --- Arno Garrels [TeamICS] http://www.overbyte.be/eng/overbyte/teamics.html The SslHttpCli is running in a seperate thread. FastMM doesn't report any memory leaks, except for a string(20 bytes) AssumeMultiThreaded is enable in FastMM. Anyone seen this before ? PAul -- To unsubscribe or change your settings for TWSocket mailing list please goto http://www.elists.org/mailman/listinfo/twsocket Visit our website at http://www.overbyte.be
Re: [twsocket] Memory leaks
BTW: Are you using (OverbyteIcs)SslThrdLock.pas which is a Must when running OpenSSL multi-threaded? No, how to use it ? Paul -- To unsubscribe or change your settings for TWSocket mailing list please goto http://www.elists.org/mailman/listinfo/twsocket Visit our website at http://www.overbyte.be
Re: [twsocket] Memory leaks
Paul wrote: BTW: Are you using (OverbyteIcs)SslThrdLock.pas which is a Must when running OpenSSL multi-threaded? No, how to use it ? It's described in the unit header. --- Arno Garrels [TeamICS] http://www.overbyte.be/eng/overbyte/teamics.html Paul -- To unsubscribe or change your settings for TWSocket mailing list please goto http://www.elists.org/mailman/listinfo/twsocket Visit our website at http://www.overbyte.be
Re: [twsocket] Memory leaks
- Original Message - From: Arno Garrels [EMAIL PROTECTED] To: ICS support mailing twsocket@elists.org Sent: Sunday, October 08, 2006 8:49 PM Subject: Re: [twsocket] Memory leaks Paul wrote: BTW: Are you using (OverbyteIcs)SslThrdLock.pas which is a Must when running OpenSSL multi-threaded? No, how to use it ? It's described in the unit header. --- Arno Garrels [TeamICS] http://www.overbyte.be/eng/overbyte/teamics.html Paul -- To unsubscribe or change your settings for TWSocket mailing list please goto http://www.elists.org/mailman/listinfo/twsocket Visit our website at http://www.overbyte.be -- To unsubscribe or change your settings for TWSocket mailing list please goto http://www.elists.org/mailman/listinfo/twsocket Visit our website at http://www.overbyte.be
Re: [twsocket] Memory leaks
I'm using V5 with this application. I don't have this unit Paul - Original Message - From: Arno Garrels [EMAIL PROTECTED] To: ICS support mailing twsocket@elists.org Sent: Sunday, October 08, 2006 8:49 PM Subject: Re: [twsocket] Memory leaks Paul wrote: BTW: Are you using (OverbyteIcs)SslThrdLock.pas which is a Must when running OpenSSL multi-threaded? No, how to use it ? It's described in the unit header. --- Arno Garrels [TeamICS] http://www.overbyte.be/eng/overbyte/teamics.html Paul -- To unsubscribe or change your settings for TWSocket mailing list please goto http://www.elists.org/mailman/listinfo/twsocket Visit our website at http://www.overbyte.be -- To unsubscribe or change your settings for TWSocket mailing list please goto http://www.elists.org/mailman/listinfo/twsocket Visit our website at http://www.overbyte.be
Re: [twsocket] Memory leaks
Hi Arno, i don't see any reason why i can't have a clent in the main thread and one in a seperate thread working together with the dll's. This would mean that 2 applications wouldn't be able to use the same SSL-dll's also Paul -- To unsubscribe or change your settings for TWSocket mailing list please goto http://www.elists.org/mailman/listinfo/twsocket Visit our website at http://www.overbyte.be
Re: [twsocket] Memory leaks
Paul wrote: I'm using V5 with this application. I don't have this unit Then you don't use latest source! It's included in IcsSslSrcV5g.zip, just downloaded and verified. --- Arno Garrels [TeamICS] http://www.overbyte.be/eng/overbyte/teamics.html Paul - Original Message - From: Arno Garrels [EMAIL PROTECTED] To: ICS support mailing twsocket@elists.org Sent: Sunday, October 08, 2006 8:49 PM Subject: Re: [twsocket] Memory leaks Paul wrote: BTW: Are you using (OverbyteIcs)SslThrdLock.pas which is a Must when running OpenSSL multi-threaded? No, how to use it ? It's described in the unit header. --- Arno Garrels [TeamICS] http://www.overbyte.be/eng/overbyte/teamics.html Paul -- To unsubscribe or change your settings for TWSocket mailing list please goto http://www.elists.org/mailman/listinfo/twsocket Visit our website at http://www.overbyte.be -- To unsubscribe or change your settings for TWSocket mailing list please goto http://www.elists.org/mailman/listinfo/twsocket Visit our website at http://www.overbyte.be
Re: [twsocket] Memory leaks
Paul wrote: Hi Arno, i don't see any reason why i can't have a clent in the main thread and one in a seperate thread working together with the dll's. This would mean that 2 applications wouldn't be able to use the same SSL-dll's also OpenSsl is thread safe as long as we provide the appropriate locking callbacks. OpenSSL is a multi-platform library, different OS use different locking methods ;-) Paul -- To unsubscribe or change your settings for TWSocket mailing list please goto http://www.elists.org/mailman/listinfo/twsocket Visit our website at http://www.overbyte.be