Wrox Programmer Forums
Go Back   Wrox Programmer Forums > .NET > Other .NET > General .NET
|
General .NET For general discussion of MICROSOFT .NET topics that don't fall within any of the other .NET forum subcategories or .NET language forums.  If your question is specific to a language (C# or Visual Basic) or type of application (Windows Forms or ASP.Net) try an applicable forum category. ** PLEASE BE SPECIFIC WITH YOUR QUESTION ** When posting here, provide details regarding the Microsoft .NET language you are using and/or what type of application (Windows/Web Forms, etc) you are working in, if applicable to the question. This will help others answer the question without having to ask.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the General .NET section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
 
Old May 1st, 2007, 11:16 AM
Registered User
 
Join Date: May 2007
Posts: 1
Thanks: 0
Thanked 0 Times in 0 Posts
Default C# Starting multiple processes from a service

Hi all,

We are working on an application that starts and stops other applications, like a service watcher. We are using MS Visual Studio 2005 Professional and coding in C#.

Our application starts processors using System.Diagnostics.Process class and the Start() method, as per code snippet below.

This application runs as a Windows service, and starts always several instances of the same application, like multiples Windows Calculator for instance. We are experiencing difficulties starting processors after a certain number is reached.

We changed the application 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 on 3 different machines.

Is there a limit on the memory a service with its child threads can consume, or are we looking in the wrong direction?

Here is the code snippet:

Process meProc = new Process();
meProc.StartInfo.FileName = "app.exe";
meProc.StartInfo.Arguments = @"/args";
meProc.EnableRaisingEvents = true;
meProc.Start();



 
Old May 3rd, 2007, 08:40 AM
Authorized User
 
Join Date: Dec 2004
Posts: 68
Thanks: 0
Thanked 0 Times in 0 Posts
Send a message via MSN to DZukiewicz
Default

Have you tried running the processes as seperate threads, rather than seperate processes?





Similar Threads
Thread Thread Starter Forum Replies Last Post
remote processes gobotsoup ASP.NET 2.0 Basics 1 May 6th, 2007 01:50 PM
Checking Processes AggressiveFish Beginning VB 6 0 September 19th, 2006 01:29 PM
Web Service with multiple functions deer_reema ASP.NET 1.0 and 1.1 Basics 2 May 3rd, 2006 01:52 PM
Manipulating Processes ? kush28 C# 1 October 26th, 2005 04:49 AM
processes in php Moharo Pro PHP 1 November 10th, 2003 08:47 AM





Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.