Process.Start() Limit out of Windows Service

  • Thread starter Thread starter Volker Thebrath
  • Start date Start date
V

Volker Thebrath

Hi,

I'm starting some Processes from out of a Windows Service. Each
Process has a GUI, but of course I can't see it. So far so good. I can
start for example 8 processes, but the 9th will not start.

I wonder if this is a limit of GDI Objects or User Objects and the
combination with a Windows service.

Has Anyone an Idea?

Greeting Volker Thebrath
 
Does the ninth process throw an exception that describes some kind of an error?

Are these distinct executables, as in, are the executables unique or nine
instances of the same full path? If they are unique, then can you change the
order and see if it truly is the ninth one or just a particular exe?
 
I'm starting some Processes from out of a Windows Service. Each
Process has a GUI, but of course I can't see it. So far so good. I can
start for example 8 processes, but the 9th will not start.

In addition to the good diagnostic advice FTM offered, I'll point out that
starting GUI processes from a Windows service isn't a good idea anyway. I
don't know why that would result in some limit on how many you can start,
but there's no reliable way to control a GUI application without a GUI.
Lots of difficult-to-solve problems could come up with a design like that.

Pete
 
Hi,

we found the reason for our problem. Windows services are by default
limited for 512 kb Heap Memory. If I change it to a higher value, I
can start more processes out of my service.

Btw. The regkey is:

HKEY_LOCAL_MACHINE\System\CurrentControlSet\Control\Session Manager
\SubSystems\Windows

Defualt value under Vista is:

%SystemRoot%\system32\csrss.exe ObjectDirectory=\Windows
SharedSection=1024,3072,512 Windows=On SubSystemType=Windows
ServerDll=basesrv,1 ServerDll=winsrv:UserServerDllInitialization,3
ServerDll=winsrv:ConServerDllInitialization,2 ProfileControl=Off
MaxRequestThreads=16

The 512 is the value, you have to increase.

Greetings

Volker Thebrath
 
Back
Top