How could I know if I am running a NGEN'ed image?

After I NGEN'ed my program and run it, I found there is no change on memory cost and running speed. I doubt if I am still running the old version(not NGEN'ed) of my program. How can I run the NGEN'ed image directly Or how can I know if I am running a NGEN'ed image

Thanks!



Answer this question

How could I know if I am running a NGEN'ed image?

  • MLT

    There is no way to run it directly, I think, nor of determining if it can be run. NGen only makes a difference if your managed assemblies are huge, and they are commonly shared dlls. How big are they

    If you have profiled and found that the JIT time is insignificant, it will likely make no difference.

    Here is an article about NGen:

    http://msdn.microsoft.com/msdnmag/issues/05/04/NGen/default.aspx

    And this describes when it may be useful (very rarely):

    http://msdn.microsoft.com/library/en-us/dnpag/html/scalenetchapt05.asp

    In particular, read the section titled "Scenarios with Limited or No Sharing Should Not Use Ngen.exe", which explains why only large, shared dlls can really benefit. Stand-alone exes will rarely benefit.

  • Bill M

    The simplest way is to look at the fuslogvw. This would give you details as to which image was used and the reasons as to why the NGEN Image wasn’t used.
  • FredV

    I have checked that place and can't find my program there. Is there some settings that may hide my program in this folder

    Thanks!

  • dberkov

    The files are in \Windows\Assembly directory.

  • spot9969

    BTW : where is the native image cache on my hard disk

    Thanks!

  • How could I know if I am running a NGEN'ed image?