469,578 Members | 1,783 Online
Bytes | Developer Community
New Post

Home Posts Topics Members FAQ

Post your question to a community of 469,578 developers. It's quick & easy.

problem starting multiple external programs from windows service

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!
May 1 '07 #1
1 1950
TRScheel
638 Expert 512MB
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!
Try creating them in different threads
May 1 '07 #2

Post your reply

Sign in to post your reply or Sign up for a free account.

Similar topics

4 posts views Thread by Mark Duregon | last post: by
7 posts views Thread by Ahmed Perlom | last post: by
7 posts views Thread by Peter S. | last post: by
By using this site, you agree to our Privacy Policy and Terms of Use.