Hi,
The number of tasks you can run as a service does
not only depend on available memory, but also on other (limited) system resources. One of them is the Desktop Heap.
Several save ways to increase the number of tasks you can run:
* Stop other unneeded Windows Services (approx. every service you stop, will give you an extra watchDirectory task that can run as a service)
* Run some of your watchDirectory tasks "normally" (not as a service).
WARNING: REGISTRY HACKS AHEAD
Change registry settings AT YOUR OWN RISK
I just did some experiments, based on this article:
http://support.microsoft.com/kb/184802/en-us(start at "Cause 2", halfway the page).
There Microsoft describes a way to increase/decrease the SharedSection value, so it allows for more or less Windows Services to run. I did a few tests, and am a little surprised by the outcome (the results are opposite to what I expected).
Please read the above article, before continuing.
I created 44 tasks, all with "run as a service" as the "how to run" method. Those tasks all used the default user (LocalSystem) and did
NOT have the service option "allow service to interact with the desktop" checked. The tasks all monitored C:\Test.
First test, with SharedSection=1024,3072,512 (default setting on my XP SP2 computer).
I am able to start
36 tasks. Task 37 will always give me the 1053 error.
Second test, with SharedSection=1024,3072,
384 It was my understanding from the Microsoft article, that this would allow for more services to run.
However, now I am able to run
26 tasks (less!).
Third test, with SharedSection=1024,3072,
640 I could start all
44 tasks. Maybe it would be possible to start more tasks (did not try).
If I understand the article correctly, the 3rd value of SharedSection, the one I varied in my tests, is only applicable to Services that run as LocalSystem without the option "interact with the desktop" checked. If your services use another account to run, you may need to alter the second value. Please
read the article carefully!!!Hope this helps,
Gert