Newsgroups : Borland : borland.public.delphi.internet.winsock : 2005 Nov : Memory creep problem in service, but there are no leaks
| Subject: | Memory creep problem in service, but there are no leaks |
| Posted by: | "Eric Carlson" (dont-spam-me@nospamplease.com) |
| Date: | Fri, 11 Nov 2005 10:19:40 |
I have a D7 Ent service app which is Indy http based and serves images which
it loads and processes before transmission. In idle times I call
SetProcessWorkingSetSize(hCurrentProc, $ffffffff, $ffffffff) and can see the
mem use figures in task manager drop right down. The problem is when all
users log off - that call has no effect, and I see refs on the net to this
being a bug in Windows. Under a test harness this figure creeps up to ~450M
(from 4M) overnight, and my service and the whole PC grinds to treacle (but
doesn't actually stop). To prove it, all I have to do is log on, then the
same service which has been running all night continues but the call starts
working, the responsiveness is back and the in use Mem count returns to 4M.
Generally, I suspect the real problem is down to not allowing the app to
cause this memory use in the first place but there are definitely no leaks
(GDI or memory) and anyway I thought if windows sees it has spare memory
won't it use it anyway? The app is so close to being a regular webserver
this problem must have been encountered and solved on all similar
service-based apps before.
Thanks for any ideas in advance...