Newsgroups : Borland : borland.public.delphi.internet.winsock : 2006 Oct : TidTCPServer Memory Leak

www.cryer.info
Managed Newsgroup Archive

TidTCPServer Memory Leak

Subject:TidTCPServer Memory Leak
Posted by:"Bogdan Mitic" (..@infomitic.com)
Date:Fri, 13 Oct 2006 09:35:21

I am using BDS 2006 with Indy 10 clients.

The setup is relativelly simple!
Client application (using TidTCPClient) connect to the server and then sends
large amounts of data by first sending the size as Int64 and then streaming
the data
    Socket,Write(lSize);.
    Socket,Write(lStream, lSize);.

Server reads this unformation into the FileStream.
    lSize := Socket.readInt64;.
    Socket.ReadStream(aFileStream, lSize);
    aFileStream.Free;

The data gets transfered perfectly, however, each time the client does this
the memory of the Server process increases and even if the client
disconnects the server the memory is never released. I believe that I mapped
the memory allocation to Socket.ReadStream(aFileStream, lSize) call, but I
am not sure how to correct this.  Within minutes of client sending data. the
server process can reach 400MB memory usage.

Am I doing something wrong, or is this indy problem.
Thanks!

Replies:

www.cryer.info
Managed Newsgroup Archive