Hi,
Our application starts an external application using System.Diagnostics.Process class and the Start() method, as per code snippet below.
This application run as a Windows service, and must start several instances of the same application, like multiple Windows Calculators for instance. We are experiencing difficulties starting applications after a certain number have been started.
We changed our app to work as a Console application and it could start an unlimited number of sub applications, but when used as a Windows Service, for some reason we can not create more instances when the limit number is reached. They start and stop without an exception (ExitCode = 0).
We collected statistics about computer committed charge, virtual memory used, available physical memory, and other numbers collected through TaskManager. We also worked with increasing the virtual memory size on the computer, and it didn't produce any changes regardless of the virtual memory used and the computer. We tested in computers with 1.5GB physical mem and 2GB physical mem; the first with 1GB and 2GB of VM and the second with 3GB and 4GB of virtual mem.
In all cases, the service application could only start 14 processes of the targeted application; the 15th instance starts, but gets shut down. We tried this in 3 different computers.
Is there a limit on the number of applications that can be started using the system.diagnostics.process class? Can anyone suggest a different way of doing this or some parameter that might allow us to run more external applications from the service?
Code snipet:
Process meProc = new Process();
meProc.StartInfo.FileName = "app.exe";
meProc.StartInfo.Arguments = @"/args";
meProc.EnableRaisingEvents = true;
meProc.Start();
Thanks in advance!