Discussion:
Memory Leak in TIdTCPServer
(too old to reply)
Samadpour
2008-05-28 07:33:22 UTC
Permalink
There are about 1.5 kb memory leak(s) when we disconnect client from server
side (within OnExute Code) but not when disconnected from client side.

Size=8 Bytes
IdStack.pas>>IdStackFactory>>Line: 389[1]

Size=144 Bytes
IdSchedulerOfThread.pas>>TIdSchedulerOfThread>>Line: 196[6]

Size=256 Bytes
IdServerIOHandlerSocket.pas>>TIdServerIOHandlerSocket>>Line: 126[6]

Size=36 Bytes
IdIOHandler.pas>>TIdIOHandler>>InitComponent>>Line: 1836[8]

Size=400 Bytes
IdIOHandlerSocket.pas>>TIdIOHandlerSocket>>Open>> Line: 321[4]

Size=616 Bytes
IdCustomTCPServer.pas>>TIdListenerThread>>Run>>Line: 910[18]

Size=64 Bytes
IdTCPConnection.pas>>TIdTCPConnection>>SetIOHandler>>Line: 630[19]

Size=64 Bytes
IdCustomTCPServer.pas>>TIdListenerThread>>Run>> Line: 926[34]
Remy Lebeau (TeamB)
2008-05-28 21:58:17 UTC
Permalink
Post by Samadpour
There are about 1.5 kb memory leak(s) when we disconnect client
from server side (within OnExute Code) but not when disconnected
from client side.
Sounds like you are not freeing every Indy object that you may be allocating
in your own code. Most of the objects you refer to are dependant on each
other. Leak one of them and the rest are leaked as well. Indy should
already be freeing everything it allocates internally.

Also, make sure you are using the absolute latest version of Indy 10. A lot
of changes and fixes are present in the current Tiburon branch that are not
in the main branch yet.


Gambit
Samadpour
2008-05-31 18:14:47 UTC
Permalink
No Remy. I didnt allocate any resource from indy within my code. I just call
disconnect from onexecute
AContext.Connection.Disconnect;
Do I need to free anything manually?
Do you want very simple application that shows the same leaks? I think
checking that sample application is better and can help locating the
problem.
I checked it with MemCheck and EurekaLog but both same results.
I dont know what you mean exactly "absolute latest version of Indy 10". I'm
using indy 10.2.3 with Delphi 7.0

Regards
Remy Lebeau (TeamB)
2008-06-02 16:41:22 UTC
Permalink
Post by Samadpour
Do I need to free anything manually?
Only things you allocate manually, if any.
Post by Samadpour
I dont know what you mean exactly "absolute latest version
of Indy 10". I'm using indy 10.2.3 with Delphi 7.0
Where did you obtain it from exactly? There are several different branches
of 10.2.3 available right now.


Gambit
Samadpour
2008-06-03 12:12:24 UTC
Permalink
Post by Remy Lebeau (TeamB)
Where did you obtain it from exactly? There are several different
branches of 10.2.3 available right now.
http://indy.fulgan.com/ZIP/indy10.zip

Remy, 4 now dont care about this post and memory leak issue. I feel i need
to more tests and make sure about that again. Thanks for your attention.
r2112
2008-06-02 20:11:59 UTC
Permalink
I have this problem too. I use IdHTTPProxyServer and my programm after every
IdHTTPProxyServer1HTTPBeforeCommand increase -112 byte. After one hour of
active work my programm, size in RAM = 1000 Mb!!!.

unit Unit1;

interface

uses
Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
Dialogs, IdBaseComponent, IdComponent, IdCustomTCPServer, IdTCPServer,
IdCmdTCPServer, IdHTTPProxyServer;

type
TForm1 = class(TForm)
IdHTTPProxyServer1: TIdHTTPProxyServer;
private
{ Private declarations }
public
{ Public declarations }
end;

var
Form1: TForm1;

implementation

{$R *.dfm}

end.
Loading...