0

I run an external process inside a C# program with the API/method:

Process p = Process.Start(exefilename);

I want to decrease the CPU consumption of the process "exefilename" and I tried to change the priority in this way:

p.PriorityClass = ProcessPriorityClass.Idle;

but I did not get any result. The processor consumption is the same.

In which way can I reduce the CPU consumption?

ste
  • 21
  • 3
  • 1
    Setting the priority doesn't necessarily reduce cpu usage, if nothing/little else requires the cpu, then the program will still be allowed to use as much cpu as it can. And this is a good thing. Does the cpu usage make your computer or other programs sluggish? – Lasse V. Karlsen Jun 29 '16 at 08:12
  • If the process does the same things, then the processor consumption is always the same. A process priority just makes the operating system schedule the process differently. But the process will still execute completely, so the actual consumption is the same. – poke Jun 29 '16 at 10:07

1 Answers1

0

First are you sure that this process is what consuming the CPU? secondly if you have its source code, you should check which portion of it is consuming the CPU (IO, DB calls) and so on.

  • I haven't the source code of the external exe. I want to limit the processor consumption, even if the performances go down. – ste Jun 29 '16 at 11:58