Avatar of abctech
abctech

asked on 

free memory in INDY10 tcp/ip server

I'm developing a TCP/IP server in Delphi 2007 with INDY10. The server is activated and a lot of client are connected to him on a GPRS way, around 150; the clients must remain connected all the time but there are communication problems which not allow this, then they can connect to the server for a long time but somehow the communication fails after a while. The server must manage all the communication and the list of context that represents the clients; also it must free memory when it disconnects a socket or a context but it does'nt do it. The server is working about 3-4 hours correctly and then it begins to accumulate memory, cpu usage, and threads.
My real question is: in Indy10, what is the correct way to free memory and threads, close sockets on the different disconnections if I'm working with context?
Programming Languages-OtherTCP/IPDelphi

Avatar of undefined
Last Comment
MerijnB
ASKER CERTIFIED SOLUTION
Avatar of Lukasz Zielinski
Lukasz Zielinski
Flag of Poland image

Blurred text
THIS SOLUTION IS ONLY AVAILABLE TO MEMBERS.
View this solution by signing up for a free trial.
Members can start a 7-Day free trial and enjoy unlimited access to the platform.
See Pricing Options
Start Free Trial
Avatar of MerijnB
MerijnB
Flag of Netherlands image

a little less powerful, but much easier to use is the trial of eurekalog: www.eurekalog.com
Avatar of abctech
abctech

ASKER

I used the two recommended solutions to find problems and exceptions when I disconnect TIdContext. Some of the found problems were fixed, but others not. The image illustrates a report of fastMM, but I dont know where I must free these resources because they are not created by me.
I still have the problem that TIdContext is not properly disconnected because the number of thread and handles that the task manager reports to me is increasing by the time, sometimes the number of threads goes down(depends on the number of disconnections) but mostly it goes up.
To explain better: normally the number of thread is 476, when the server starts, it goes to 550(depends on  the number of connected clients), and in a few hours(5 or 6 more exactly), it goes to 800. At that point I must have to restart the server because it loses the capacity of receiving new connections.

memory-leak.jpg
SOLUTION
Avatar of MerijnB
MerijnB
Flag of Netherlands image

Blurred text
THIS SOLUTION IS ONLY AVAILABLE TO MEMBERS.
View this solution by signing up for a free trial.
Members can start a 7-Day free trial and enjoy unlimited access to the platform.
Delphi
Delphi

Delphi is the most powerful Object Pascal IDE and component library for cross-platform Native App Development with flexible Cloud services and broad IoT connectivity. It provides powerful VCL controls for Windows 10 and enables FMX development for Windows, Mac and Mobile. Delphi is your choice for ultrafast Enterprise Strong Development™. Look for increased memory for large projects, extended multi-monitor support, improved Object Inspector and much more. Delphi is 5x faster for development and deployment across multiple desktop, mobile, cloud and database platforms including 32-bit and 64-bit Windows 10.

60K
Questions
--
Followers
--
Top Experts
Get a personalized solution from industry experts
Ask the experts
Read over 600 more reviews

TRUSTED BY

IBM logoIntel logoMicrosoft logoUbisoft logoSAP logo
Qualcomm logoCitrix Systems logoWorkday logoErnst & Young logo
High performer badgeUsers love us badge
LinkedIn logoFacebook logoX logoInstagram logoTikTok logoYouTube logo