locked
Rebuild the Native Image Cache RRS feed

  • Question

  • Hello

    I am using a small 30gb SSD and i searched the net for guides on how to slim down my windows installtion and one of them suggested i delete my native image caches in the C:\Windows\Assembly folder

    As i test i deleted NativeImages_v2.0.50727_32 and NativeImages_v2.0.50727_64 using the ngen.exe delete * command

    I got around 800mb of space back

    My system seems fine so far all my apps work and i cant really notice any slow down but then again im using an ssd so probably wouldn't notice one anyway

    but say i wanted to restore the native image cache what command can i use

    thanks :)

     

     

    Saturday, October 2, 2010 10:05 PM

Answers

  • Hi there. I Think Mr. SamAgain is correct, but I will try to explain the same thing in a different way.

    The native images are controlled by the framework engine. You can use the ngen utility to create native images at your will, but it seems to me that you want to restore native images generated by the framework installation.

    I think the only possible way to perform it is:

    to create a list of every native image file generated on the native image directory  (use the command ngen display * )

    if for some reason you want to restore those images some day, you will have to execute the ngen install based on such list.

    The result its that you will have the same images recreated.

     

    Good luck

    • Marked as answer by SamAgain Tuesday, October 12, 2010 5:46 AM
    Tuesday, October 5, 2010 3:51 PM
  • Hi,

    If native image is not available, JIT compilation will be used. So it won't cause problems as long as JIT compilation could succeed. If your are interested in native image, please take a look at this article. It addresses native image and the tool to generate it in greate detail.


    Please mark the right answer at the right time.
    Thanks,
    Sam
    • Proposed as answer by Christiano Coutinho Tuesday, October 5, 2010 3:52 PM
    • Marked as answer by SamAgain Tuesday, October 12, 2010 5:46 AM
    Tuesday, October 5, 2010 2:14 PM
  • thanks for all the replies

    Ive decided to restore windows from the system image i made before i deleted the cache

    while the extra disk space is nice i dont want to risk messing something up down the line

    it really is annoying the way the OS just eats disk space

    my windows folder has grown (mainly cause of the assembly folder) from 14.2 GB to 15 GB overnight without me really doing anything or making any changes and it will grow even more

    with a small ssd i really feel the loss of space

    :(

     

    • Marked as answer by SamAgain Tuesday, October 12, 2010 5:46 AM
    Wednesday, October 6, 2010 12:28 AM
  • Hi,

    Thanks for your feedback. Here is a tutorial addressing how to shrink a Windows7 installation down to less than 4G. I think you may be interested in it. Also, please consider Windows 7 Installation, Setup, and Deployment forum for better advices on how to install Windows 7 on medium with limited size.


    Please mark the right answer at the right time.
    Thanks,
    Sam
    • Edited by SamAgain Wednesday, October 6, 2010 3:05 AM refine
    • Marked as answer by SamAgain Tuesday, October 12, 2010 5:46 AM
    Wednesday, October 6, 2010 3:04 AM

All replies

  • Hi,

    Thanks for your post. The native image cache is a reserved area of the global assembly cache. Assemblies shipped with .NET Framework as well as the native images created by the user for custom assemblies are stored there. When .NET Framework is installed, native images for the .NET Framework  assemblies will be generated at install time. So to restore these assemblies, please trying re-installing the .NET Framework. For cutom assemlies, I'm afraid they have to re-generated manually.

    Some further reference could be found here.


    Please mark the right answer at the right time.
    Thanks,
    Sam
    • Edited by SamAgain Monday, October 4, 2010 4:17 AM refine
    Monday, October 4, 2010 4:17 AM
  • Hello

    I dont think i can reinstall .NET Framework 2.0 as i am using Windows 7 and it comes built in

    Will deleting the Native image cache cause me any problems in the future or is it purely something to do with optimaztion and faster start up times for the .NET applications

    i made a system image before i deleted the cache that i can easily restore

    do you think i should restore or leave things as they are

    my system appears to be running fine without any problems so far

    Tuesday, October 5, 2010 1:49 AM
  • Hi,

    If native image is not available, JIT compilation will be used. So it won't cause problems as long as JIT compilation could succeed. If your are interested in native image, please take a look at this article. It addresses native image and the tool to generate it in greate detail.


    Please mark the right answer at the right time.
    Thanks,
    Sam
    • Proposed as answer by Christiano Coutinho Tuesday, October 5, 2010 3:52 PM
    • Marked as answer by SamAgain Tuesday, October 12, 2010 5:46 AM
    Tuesday, October 5, 2010 2:14 PM
  • Hi there. I Think Mr. SamAgain is correct, but I will try to explain the same thing in a different way.

    The native images are controlled by the framework engine. You can use the ngen utility to create native images at your will, but it seems to me that you want to restore native images generated by the framework installation.

    I think the only possible way to perform it is:

    to create a list of every native image file generated on the native image directory  (use the command ngen display * )

    if for some reason you want to restore those images some day, you will have to execute the ngen install based on such list.

    The result its that you will have the same images recreated.

     

    Good luck

    • Marked as answer by SamAgain Tuesday, October 12, 2010 5:46 AM
    Tuesday, October 5, 2010 3:51 PM
  • thanks for all the replies

    Ive decided to restore windows from the system image i made before i deleted the cache

    while the extra disk space is nice i dont want to risk messing something up down the line

    it really is annoying the way the OS just eats disk space

    my windows folder has grown (mainly cause of the assembly folder) from 14.2 GB to 15 GB overnight without me really doing anything or making any changes and it will grow even more

    with a small ssd i really feel the loss of space

    :(

     

    • Marked as answer by SamAgain Tuesday, October 12, 2010 5:46 AM
    Wednesday, October 6, 2010 12:28 AM
  • Hi,

    Thanks for your feedback. Here is a tutorial addressing how to shrink a Windows7 installation down to less than 4G. I think you may be interested in it. Also, please consider Windows 7 Installation, Setup, and Deployment forum for better advices on how to install Windows 7 on medium with limited size.


    Please mark the right answer at the right time.
    Thanks,
    Sam
    • Edited by SamAgain Wednesday, October 6, 2010 3:05 AM refine
    • Marked as answer by SamAgain Tuesday, October 12, 2010 5:46 AM
    Wednesday, October 6, 2010 3:04 AM