6

Is there a way to programmatically launch a background (i.e. non-windowed) executable without launching an associated conhost.exe process?

I have tried code such as this in the launcher process that spawns the worker process(es):

var process = new Process();

process.StartInfo.FileName = executable;
process.StartInfo.Arguments = args;
process.StartInfo.UseShellExecute = false;
process.StartInfo.CreateNoWindow = true;

Any help would be appreciated.

Context:

We are doing performance and load testing. To replicate our large customer environments, we have leased server capacity to allow us to run thousands of virtual servers but they are memory constrained (~ 300-500MB memory per VM).

The scenario is to run 100 processes per VM. The combination of the ~1.3 MB executable process and the 4-5 MB conhost.exe process (on Windows Server Standard Edition core update 1803) makes it impossible to run 100 processes. If we could eliminate the associated conhost.exe, we'd have a shot.

Note: conhost is much smaller on a Windows 7 environment (< 800KB) but we have to use Windows server.

This same scenario works on Linux.

psparago
  • 1,113
  • 11
  • 21
  • 2
    conhost.exe is always required by a console mode app. So don't make it a console mode program. https://stackoverflow.com/a/2686476/17034 – Hans Passant Nov 15 '18 at 22:20
  • You might change your console settings (window/buffer width and window/buffer height) to maybe squeeze out a few more bytes... – Markus Safar Nov 16 '18 at 01:17
  • The memory allocated to VMs is their "physical" memory. The memory used by processes is *address space*. If you add up the address space usage for all processes it'll often be far larger than the amount of memory that the OS is currently providing to those processes. – Damien_The_Unbeliever Nov 16 '18 at 07:38

0 Answers0