Free Your Memory Space

Every time we’re opening program, the program doesn’t load the .exe file only, it calls its all library files to memory as well. Unfortunately, by default Windows XP doesn’t always unload the library file from memory when we close the program that using that .dll file. So, I will share a little trick to unload the library files from memory when the programs don’t need them anymore.
OK, we will change our registry value for it, just follow these steps:
1. Open your Registry Editor, click Start – Run menu and then type regedit in the textbox.

2. After Registry Editor has opened,

point your cursor to registry path : HKEY_LOCAL_MACHINE | SOFTWARE | Microsoft | Windows | CurrentVersion | Explorer.

3. Find the AlwaysUnloadDLL key, if you can’t find it just create it by right click on empty space on right panel Registry Editor and the click New – DWORD value.

4. Type AlwaysUnloadDLL for new key and then press ENTER key.

5. Double click on AlwaysUnloadDLL to change its value.
6. After Edit DWORD value window appear

replace the original value 0 with 1 and then click OK button.

7. The value of AlwaysUnloadDLL key will change.

8. Close your Registry Editor and then restart your computer.
9. Your memory can breathe again now.
10. To restore the original state / setting just replace value 1 to 0 for AlwaysUnloadDLL key or delete it.
(article no:0059)
2 Comments
Edi Kwie on November 4th, 2008
Thanks for your additional information. I never told that Microsoft has made a mistake to the design of Windows XP, including about memory management. I realize that Microsoft has their own reasons to do it. But, on other hand, I just write that Microsoft has ‘prepared’ a way to unload .dll files through registry, so I wrote it. But, I heard this trick is not supported on Windows XP SP2 anymore… But the decision still on users hand.
![Otak Atik [dot] Com](http://www.otakatik.com/wp-content/themes/typebased/styles/default/logo.jpg)


Larry Miller on November 4th, 2008
BAD IDEA
The author appears to be ignorant of an important Windows feature. DLL’s are indeed retained in memory after a program close. This is NOT a mistake but a carefully designed feature known as caching. Caching has had a long and distinguished history and it is highly developed in XP.
Windows designers understand XP better than you do. Do not take this authors well meaning but uninformed advice. Windows will perform best without amateurish tinkering such as this.
Larry Miller
Microsoft MCSA