473,396 Members | 2,081 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,396 software developers and data experts.

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 2194
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

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

Similar topics

0
by: David | last post by:
I've written a small windows service, and I'm having a problem that I'm spending a lot more time on than I'd like. If anyone has experienced this problem and has any hints or solutions; they would...
4
by: Mark Duregon | last post by:
Hi, I am trying to create a Windows Service in C# that will install on a single box to support multiple environments. I have created the service and it works perfect. Now however, the client has...
2
by: feman | last post by:
I'm trying to install the dotnet framework 1.1 on a Windows 2000 Pro, SP 4 box. I've downloaded dotnetfx.exe and am installing from c:\temp. This is the error message that I get: Error 1606....
1
by: Glenn | last post by:
I have used this code successfully in a form application. I tried to add the same code in a service and have not been able to get the application to start. I have the service starting with a local...
4
by: hogcods | last post by:
I'm having a strange problem with a service I developed. After installing the service on the target machine, I'm trying to start it using the Services admin window. I get the "Windows is starting"...
8
by: Kevin D. | last post by:
Please note, I already posted this on the MySQL official forum, but received no response. I thought I'd try again in another location. My apologies to anyone reading this twice... Despite...
7
by: Ahmed Perlom | last post by:
Hi all, I am trying to start a windows application that has a GUI from a Windows service written in .NET 2.0. I have been searching on this for few days now with no avail. When using the...
7
by: Peter S. | last post by:
I currently have created a C# program that automatically updates an SQL database once everyday. It's an application that I manually start. I want make it so that if the (Windows 2003) server...
7
by: tim | last post by:
Hi all, I want to execute a VB application from a ASP page (not .Net). Want I want to do is that I write some parameters to a database and then start the external application that will pickup...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.