Windows IT Pro is the authoritative and independent resource for windows nt, windows 2000, windows 2003, windows xp. Features a collection of resources and magazines for windows IT professionals.
  
  
  Advanced Search 


January 2004

The Memory-Optimization Hoax

RAM optimizers make false promises
RSS
Subscribe to Windows IT Pro | See More Internals and Architecture Articles Here | Reprints | Or get the Monthly Online Pass—only $5.95 a month!

As you've surfed the Web, you've probably seen browser pop-ups such as "Defragment your memory and improve performance" and "Minimize application and system failures and free unused memory." The links lead you to utilities that promise to do all that and more for a mere $9.95, $14.95, or $29.95. Sound too good to be true? It is. These utilities appear to do useful work, but at best, RAM optimizers have no effect, and at worst, they seriously degrade performance.

Literally dozens of so-called "memory optimizers" are available—some are commercial products and others are freeware. You might even be running such a product on your system. What do these products really do, and how do they try and fool you into thinking that they live up to their claims? Let's take a look inside memory optimizers to see exactly how they manipulate visible memory counters in Windows.

The Memory Optimizer UI
Memory optimizers typically present a UI that shows a graph labeled Available Memory and a line representing a threshold below which the product will take action. Another line typically shows the amount of memory that the optimizer will try to free when it runs. You can usually configure one or both levels, as well as trigger manual memory optimization or schedule optimizations. Some of the tools also display the processes running on the system.

When a scheduled optimization job runs, the utility's available-memory counter often goes up, sometimes dramatically, which appears to imply that the tool is actually freeing up memory for your applications to use. To understand how these utilities cause the available-memory line to rise, you first need to understand how Windows manages physical memory.

Windows Memory Management
Like most modern OSs, Windows implements a demand-paged virtual-memory system. An OS uses virtual memory to give applications the illusion that a computer has more physical memory than it actually does.

On 32-bit Windows systems, processes have a virtual-memory address space of 4GB that the OS typically divides equally between the process and the system. Thus, a process can allocate as much as 2GB of virtual memory, depending on the amount available. The total amount of virtual memory allocated to all processes can't exceed the sum of the system's paging files and most of its physical memory (the OS reserves a small portion of physical memory).

Given that processes can, with a large enough paging file, allocate virtual memory that exceeds the computer's physical memory capacity, the Windows Memory Manager subsystem must share physical memory among processes and the Cache Manager's cached file data. As Figure 1 illustrates, the Memory Manager assigns each process (e.g., Microsoft Word, Notepad, Windows Explorer) a part of physical memory, which is known as the process's working set. The portions of the kernel and drivers that are pageable, in addition to pageable kernel-memory buffers, called paged pool, and physical memory that the Cache Manager manages, are assigned their own working set, called the System working set.

The Memory Manager expands and contracts the System and processes' working sets in response to the needs of processes for quick access to their code and data. The computer's memory-management hardware requires that Windows manage working sets and virtual memory in page-size blocks. (On 32-bit x86 processors, pages are typically 4096 bytes in size. However, the OS and memory-intensive applications also use large pages of 4MB as an optimization, when possible.)

When a process accesses a page of its virtual memory that isn't present in its working set, the process incurs a page fault hardware exception. When that happens, the Memory Manager assigns a page of available physical memory to hold the newly accessed data. Additionally, the Memory Manager might decide to expand the process's working set by adding the page to the working set. However, if the Memory Manager deems the process's working set to be large enough, it will exchange a page already in the working set with the new page, choosing for replacement the page that the process accessed least recently, under the assumption that the process is least likely to access that page in the near future.

When the Memory Manager removes a page from a process working set, it must decide what to do with that page. If the page has been modified, the Memory Manager first puts it on the modified page list, a list of pages that eventually will be written to the paging file or to the memory-mapped files to which the pages correspond. From the modified page list, the Memory Manager moves pages to a pool called the standby list. Unmodified pages go directly to the standby list. Thus, you can view the standby list as a cache of file data.

   Previous  [1]  2  Next 


Reader Comments
Regarding Mark Russinovich's technically detailed and otherwise excellent article Internals: "The Memory-Optimization Hoax" (January 2004, http://www.winnetmag.com, InstantDoc ID 41095), which debunks memory "optimization" utilities, I have just one comment: Free memory is the enemy of true performance. <P>
This statement might strike many computer users as ridiculous, but with explanation it makes sense. Mark's article touches on this concept but then buries it under technicalities. If my OS isn't using all its memory, it's not using my machine to full capacity. Yes, a small portion of memory must remain unallocated to give the system room to work in, but all the rest
of the memory should be used. I'm not referring to a situation such as running the system at near-maximum capacity and filling the entire virtual memory subsystem with a data set. I'm referring to modern, lightly loaded systems with large amounts of excess physical RAM that under usual circumstances will never be completely used. Ideally, the OS should use such excess RAM for caching, reallocating it only as needed. If the OS aggressively frees memory for some unknown future need, then data that the OS could have retrieved from RAM will instead require a disk read, incurring a massive performance penalty.<P>
I became aware of this counterintuitive concept when I began to use FreeBSD. I learned from a Usenet thread that near 100 percent memory usage is not only "normal" but indicative of a properly working system. Now, I measure an OS not only by how much memory it keeps free but also by how much it uses. I realize that the situation is a bit more complicated than I've described, but my point is that free memory is not your friend. You paid good money for your RAM. Do you really want it to be unused? <P>

I agree that an OS's job is to give memory to processes running on a system so that the processes can run efficiently and that this job requires using all physical memory. However, as I stated in my article, the Windows Memory Manager allocates memory by effectively using all "free" memory for cached file data, which the standby list stores. The Memory Manager uses this system to assign to certain processes only the memory they actually need so that other processes can get the memory that they actually need. One way the Memory Manager accomplishes this goal is by taking memory away from a process that doesn't need it and placing the unneeded memory on the standby list. If that process requests data from the standby list, it receives the data immediately; however, the memory demands of other processes might require that they also take memory from the standby list. The standby list serves as the file-system and paging-file cache, and even though memory on the list is considered "available," it's nevertheless actively used and therefore doesn't fit Henry's definition of free memory. <br>
--Mark Russinovich

Henry Mason January 23, 2004


I agree 99 % with your analysis. However, the Windows memory management algorithm is not perfect (who, err, which is?:). Consequently, in rare circumstances, brute-forcing pages out of physical memory might actually improve performance of some applications. For a - somewhat related - discussion on Linux's VMM logic, the discussion on http://lwn.net/Articles/83588/ might be interesting ( I am not qualified to judge Windows's against Linux's MM).

Andreas June 11, 2004


I would agree that some claims are frivolous or incorrect, however to state the creating more Available Memory doesn't help is incorrect IMO.For gamers forcing other processes out of memory to the VM is a good thing. Not everyone likes to use Task Manager to End Processs. One game for example is Planetside. Its a fun game, but a major resource hog, the more Free Memory you can throw at it the better, and the pause after quitting to get back to the desk as the system unpages other stuff is fine with me. It shows that the utility did exactly what I wanted it to do, which was free memory for use by the game. As for Memory Leaks not being helped, I'll study more on that one. While it may not fix the memory leak issue, even forcing the unused data to the VM so that the process can use more Physical Memory again is a good thing. It speeds things back up. Though, I'll agree that the only real fix is to restart the applications from time to time if not even restarting Windows.

Players of Planetside and other games will agree the more memory the better. If your claim that more Available Memory not being beneficial was correct, with regards to gaming, then most all Gamers (who lead the push for higher end PC parts)are all wrong for running 1Gb + of memory to increase performance. We should all be happy as clams with 512Mb as we can just page everything to VM and run it from there.

If you decide to argue that gamers don't make up a large portion of the computing community you again would be wrong. Its a multiBillion dollar industry that is only getting bigger as time goes on.

I will agree a desktop user running Word, Browswers, email, etc prob wouldn't find these Utilities useful, I think they can have a place of usefulness in the gaming Community for games we love that happen to be RAM HOGS.

Greg Waggoner June 13, 2004


Criticism is good but do you have solution for freeing RAM when my comp is slow with 512 MB of RAM? If it's true that memory management frees up my RAM after process exit, why is my RAM so occupied? Windows is not as perfect as you write in your article. They also have many bugs and some of your claims are not true at all.

Miro June 14, 2004


I agree with the problem with these "memory optimizers" - I've tried some and they claim it works, but I don't notice or gain anything. For gamers like myself, though (and anyone that wants to free up more memory), more memory is key. And so is reducing the CPU cycles taken up by unnecessary programs. Going through Task Manager is a pain, but a co-worker told me about this software called TAG. I downloaded it, ran it, and it did a real nice job of clearing things out of memory and loaded them back in when I was done playing. It doesn't claim to be one of these "force memory to disk and then unload it" and they say so on their website. Just want to throw in my 2 cents of what I've found that actually works.

Jenna July 01, 2004


I agree with your comments on the Memory Management process.
What I recommend to enhance your Windows experience is to de-activate any useless "Startup program" or "Service".

Good links to find more on these points are:
== 12 Tweaks for performance (+ help to disable services)
http://www.blackviper.com/WinXP/supertweaks.htm
== Utility to disable Startup Applications
http://www.sysinternals.com/ntw2k/freeware/autoruns.shtml
== List of Startup Applications
http://www.pacs-portal.co.uk/startup_index.htm

And, if you need a RAM Optimizer (because you run Windows 95/98/ME), you can use this little one.
It has a very small memory footprint.
http://www.jfitz.com/software/RAMpage/
I quote from the FAQ:
"Note that NT, 2000 and XP are all based on the NT kernel. There is no compelling evidence to suggest that freeing memory does anything to improve performance or reliability on these systems, (in fact it will generally have a minor negative impact on performance). These versions also include memory monitoring screens in the Task Manager, so I don't think there is much point running RAMpage on these systems."

Florent July 03, 2004


There's hundreds or even thousands of registry tweaks available for free on the net. Don't pay a dime for tweaking programs eaither.

Joe July 03, 2004


Does the program Cache Boost fall into the category of memory optimizer?

Cacheboost optimizes the System Cache-Management of Windows XP/2000/NT and Windows .Net Servers. This results in an best performance boost - without any new hardware, any hardware tweak, and without restricting your system's stability. Simply install Cacheboost and you are ready to go. No special configuration or rebooting is needed. Within minutes you activate unused resources of your Windows XP/NT/2000 and Windows .Net systems.

CODE
More Info:

http://www.systweak.com/cacheboost/overview.asp

Doug July 04, 2004


I would like to know your opinion about all those claims of "perfect" memory management and memory compactation that RDBMS like Oracle claims. It isn't real memory masked behind virtual memory? What kind of memory compactation they do, if they relay in virtual memory paging?

Jorge July 05, 2004


hey guys - i might be getting off the topic a bit here but can't resist putting this in...

over the years i have noticed that when doing a ctrl-shift-esc (start task manager) explorer memory size can be quit large (click on memory column to sort by size). i have found the best way to fix this problem (aside from the obvious "reboot fixes 9 out of 10 problems) is to 'end task' on explorer then do a 'file' 'new task' and type explorer. this starts a new instance of explorer with a lot smaller footprint (also save yourself $9.95)!!

smeg July 05, 2004


 See More Comments  1   2   3   4   5   6   7   8   9   10   11   12   13   14   15   16   17   18   19   20   21   22   23   24   25   26   27   28   29   30   31   32   33   34   35   36   37   38   39   40   41   42   43   44   45   46   47   48   49   50   51   52   53   54   55   56   57   58   59   60   61   62   63   64   65   66   67   68   69   70   71   72   73   74   75   76   77   78   79   80   81   82   83   84   85   86   87   88   89   90   91   92   93   94   95   96   97   98   99   100   101   102   103   104   105   106   107   108   109   110   111   112   113   114   115   116   117   118   119   120   121   122   123   124   125   126   127   128   129   130   131   132   133   134   135   136   137   138   139   140   141   142   143   144   145   146   147   148   149   150   151   152   153   154   155   156   157   158   159   160   161   162   163   164   165   166   167   168   169   170   171   172   173   174   175   176   177   178   179   180   181   182   183   184   185   186   187   188   189   190   191   192   193   194   195   196   197   198   199   200   201   202   203   204   205   206   207   208   209   210   211   212   213   214   215   216   217   218 

You must log on before posting a comment.

If you don't have a username & password, please register now.




Top Viewed ArticlesView all articles
Command Prompt Tricks

One reader shares his tip for setting up the command prompt to reflect a remote path. ...

New Microsoft/Yahoo! Deal? No

On Sunday, the Times of London reported that Microsoft had renewed talks with failing Internet giant Yahoo! and would manage its search engine for 10 years, while Yahoo! would retain control of its email, messaging, and content services. This report ...

How can I stop and start services from the command line?

...


Windows OSs Whitepapers Why SaaS is the Right Solution for Log Management

Related Events Virtualization Management

Virtualization for Mission-Critical BI with SQL Server

Check out our list of Free Email Newsletters!

Windows OSs eBooks Understanding and Leveraging Code Signing Technologies

A Guide to Windows Certification and Public Keys

SQL Server Administration for Oracle DBAs

Related Windows OSs Resources Become a VIP member of the Windows IT Pro community!
Get it all with the VIP CD and VIP access. A $500+ value for only $279!

Subscribe to Windows IT Pro!
Solve your toughest technical problems with our experts and access 10,000 + articles online. 30% off

Monthly Online Pass - Only $5.95!
Get instant access to 10,000+ articles from Windows IT Pro Magazine!

TechNet Virtual Labs
Evaluate and test Microsoft's newest products.


Windows IT Pro Home Register FAQ for Windows WinInfo News
Europe Edition About Us Contact Us/Customer Service Media Kit Affiliates / Licensing  
SQL Server Magazine Office & SharePoint Pro Windows Dev Pro IT Job Hound ITTV
IT Library Technology Resource Directory Connected Home Windows Excavator Windows SuperSite 
 
 Windows IT Pro is a Division of Penton Media Inc.
 Copyright © 2008 Penton Media, Inc., All rights reserved. Terms and Use | Privacy Statement | Reprints and Licensing