Newsgroups : Borland : borland.public.delphi.internet.winsock : 2007 Jan : TIdCustomHTTPServer - Abandoned threads

www.cryer.info
Managed Newsgroup Archive

TIdCustomHTTPServer - Abandoned threads

Subject:TIdCustomHTTPServer - Abandoned threads
Posted by:"Mike B." (mbrickm..@radsol.co.uk)
Date:29 Jan 2007 06:42:00

I have an HTTP server developed using Delphi 7/Indy 10 (recently
upgraded from Indy 9) and would like to get to grips with a problem
that has been there from day one.  Although the application is rock
solid (and has been in production for several years), it continues to
gobble up more and more threads as the day goes on.

To diagnose the problem, I have created my own idContext class and
assign this to ContextClass.  We then note the activity for each of
these contexts.  What we find is that many of these contexts are never
destroyed (nor presumably are their threads) - even though there has
been no activity for several hours.  Most contexts/threads are killed
when the user goes away, but the persistent ones seem to hang around
until the server is restarted.

My Questions are:

1)    Can anyone account for why threads/contexts get abandoned in an in-
active state.
2)    Is there a safe way of tidying up these threads.

We are also consuming memory as the day goes on, but I suspect this
issue is related to the threads problem as the memory used is roughly
proportional to the number of threads used.  We have checked for
memory leaks with FastMM4.

Replies:

www.cryer.info
Managed Newsgroup Archive