Thursday, August 7, 2008

Unload Unused DLLs

XP has a very bad habit, Even after an application is closed the associated DLL files still exist in memory. This can waste some precious resources and memory. This also cause stability problems. Make the DLLs unload themselves from memory after the program is done running.



Navigate to:

HLM\SOFTWARE\Microsoft\Windows\CurrentVersion\

Explorer\AlwaysUnloadDLL




If the DWORD AlwaysUnloadDLL is not present, you will need to create it. Set the Value of the ?(Default)? setting to 1. Application-associated DLLs will get unloaded when the application

is closed.

1 comment:

lmiller7 said...

This is not a bad habit, it is a carefully designed feature that improves performance. This is known a caching, a feature with a long and distinguished history in computer systems. Windows has a complex and efficient system to reclaim memory used by caching when it is needed.

The author was misled. This tip has been around the internet for years now. It is based on a complete misunderstanding of how caching works.

Larry Miller
Microsoft MCSA