none
What is the Microsoft .net Optimization service? RRS feed

  • Question

  • What is the program and why does it consume so much cpu resources,  I have it diabled in Services option

    Wednesday, June 9, 2010 9:51 PM

Answers

  • This service populates the native image cache in the background.  Once it finishes its work, it should not consume additional CPU resources.  I'm guessing you haven't waited long enough (or are constantly installing assemblies -- that would be bad).

    The native image cache contains code that is compiled ahead of time (instead of as the program is being run).  When a .NET program is installed, it may instruct this service to compile the native image in the background.

    With the service running, you can use "c:\Windows\Microsoft.NET\Framework\v2.0.50727\ngen queue status" to check on this.  (If .NET 4.0 is installed, also try with substitution v4.0.30319.)

    You can also use "c:\Windows\Microsoft.NET\Framework\v2.0.50727\ngen executeQueuedItems" to force the pending assemblies to be processed.

    For detailed info on the service, see: http://msdn.microsoft.com/en-us/magazine/cc163808.aspx

     

    • Proposed as answer by SamAgain Thursday, June 10, 2010 4:07 AM
    • Marked as answer by SamAgain Thursday, June 10, 2010 4:12 AM
    Wednesday, June 9, 2010 11:51 PM
  • Hi,

      You can precompile your application with NGen by using the ngen.exe tool that ships with the Microsoft .NET Framework redistributable. The .NET Framework 2.0 has a completely reworked version of this tool and also has a new NGen service called the .NET Runtime Optimization service, which is capable of NGen-compiling assemblies in the background. Thus, NGen now supports both synchronous and asynchronous compilation. 

      For more information, please refer to The Performance Benefits of NGen.


    Please mark the right answer at right time.
    Thanks,
    Sam
    • Edited by SamAgain Thursday, June 10, 2010 4:11 AM refine
    • Marked as answer by SamAgain Thursday, June 10, 2010 4:12 AM
    Thursday, June 10, 2010 4:09 AM

All replies

  • This service populates the native image cache in the background.  Once it finishes its work, it should not consume additional CPU resources.  I'm guessing you haven't waited long enough (or are constantly installing assemblies -- that would be bad).

    The native image cache contains code that is compiled ahead of time (instead of as the program is being run).  When a .NET program is installed, it may instruct this service to compile the native image in the background.

    With the service running, you can use "c:\Windows\Microsoft.NET\Framework\v2.0.50727\ngen queue status" to check on this.  (If .NET 4.0 is installed, also try with substitution v4.0.30319.)

    You can also use "c:\Windows\Microsoft.NET\Framework\v2.0.50727\ngen executeQueuedItems" to force the pending assemblies to be processed.

    For detailed info on the service, see: http://msdn.microsoft.com/en-us/magazine/cc163808.aspx

     

    • Proposed as answer by SamAgain Thursday, June 10, 2010 4:07 AM
    • Marked as answer by SamAgain Thursday, June 10, 2010 4:12 AM
    Wednesday, June 9, 2010 11:51 PM
  • Hi,

      You can precompile your application with NGen by using the ngen.exe tool that ships with the Microsoft .NET Framework redistributable. The .NET Framework 2.0 has a completely reworked version of this tool and also has a new NGen service called the .NET Runtime Optimization service, which is capable of NGen-compiling assemblies in the background. Thus, NGen now supports both synchronous and asynchronous compilation. 

      For more information, please refer to The Performance Benefits of NGen.


    Please mark the right answer at right time.
    Thanks,
    Sam
    • Edited by SamAgain Thursday, June 10, 2010 4:11 AM refine
    • Marked as answer by SamAgain Thursday, June 10, 2010 4:12 AM
    Thursday, June 10, 2010 4:09 AM