Unload DLLs From System Memory

May 5, 2008 by Arun  
Filed under dll

After a certain amount of time, Windows starts caching DLLs into memory, which can be a waste.

You can get Windows to automatically unload the DLLs. To do this,

1. Start the Registry Editor.

2. Browse to the below key.

3.HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Explorer.

4. Now create a new key called “AlwaysUnloadDLL”.

5. Change the (default) string value to “1”
[ratings]

Share this Article :
  • Digg
  • StumbleUpon
  • Technorati
  • del.icio.us
  • Facebook
  • Google
  • Live
  • Print this article!
  • Reddit
  • SphereIt
  • YahooMyWeb

If you like this Post and get Benifitted by it , Don't forget to subscribe to my RSS feed and comment below. Thanks for visiting!

People who read this also read..

Comments

One Comment on "Unload DLLs From System Memory"

  1. Larry Miller on Sun, 11th May 2008 7:15 am 

    BAD IDEA

    Windows normal behavior of caching DLL’s is a carefully designed feature to improve performance. Can this be a waste of memory? Absolutely. Wasted memory is any memory that is not currently being used to our advantage. When a DLL is unloaded the memory becomes free and doing absolutely nothing. Free memory is the absolute ultimate in wasted memory.

    A guiding principle in the design of Windows was that memory must be used if it to be of value. Free memory is a waste and enemy of performance. Whenever possible, Windows will always try to use all of memory, even if it is for something of trivial importance. But this memory is never wasted. Windows has a sophisticated system for reclaiming this memory if and when it is required. Forcing this to occur prematurely will impair performance.

    Windows designers know memory management better than you do. Windows will perform better without amateurish tinkering like this. Experienced systems administrators have known this for a long time.

    Larry Miller
    Microsoft MCSA
    CompTIA Network+, A+

Tell us what you're thinking...
and oh, if you want a pic to show with your comment, go get a gravatar!