0

I'd like to decrease my cache size, because I have a slow disk and run a swap-less system (it's pretty snappy that way). I have x86 Vista and 3 GB RAM. The problem is that Windows eats about 1 GB RAM for disk cache (shown in Task Manager under Physical Memory -> Cached), that leaves only 2 GB for applications. A very annoying pop-up pops up every time when Windows thinks it's low on memory and of course apps crash when the memory is used. But there's still 1 GB sitting in the cache!

I've tried AnalogX Cache Booster, but it didn't do anything, memory usage stays the same, warning pop ups are at the same levels.

Axarydax
  • 1,247

3 Answers3

6

I have ... a swap-less system

I used to think the same way. I've since learned that, in MS Windows, this is a bad idea and can actually hurt performance.

Windows thinks of RAM more as an optimization layer over the hard disk. It doesn't want to wait until you have to swap RAM out before paging/swapping it to disk. Instead, Windows wants anything you put in RAM to already be paged/swapped.

This way, when Windows needs the RAM for something else, it can just use it. This strategy works because it places the (slow) disk writes at the points when your computer is less stressed, at the expense of slightly slower application loads and maybe paging some things it doesn't need to, rather than at the point when your computer is already more stressed and running low on RAM.

Of course, by removing the paging file completely you might tend to think that you get the best of both worlds. However, there's loads of code in Windows that is optimized assuming the performance model I just described. You're really better off making sure you have at least as much swap space as you do RAM.

Joel Coehoorn
  • 28,637
2

By default, Vista (and later) x86 will only allow 2 GB of virtual memory for each process. If one application needs more, for example 3GB, you can increase this by :

bcdedit /set IncreaseUserVa 3072

However this will only work for executables that were linked with the "large address aware" flag. Processes running other exe's will still be limited to 2 GB.

Real RAM is allocated as required for both applications and the system.

As this doesn't seem to be your problem, then to optimize the usage of memory one can first Disable SuperFetch on Windows Vista :

The SuperFetch service in Windows Vista preloads your system’s memory with the applications that you use most often. This makes launching of those applications much faster, but it might be an unwanted behavior for system tweakers or gamers.

Secondly, to control the disk cache size, AnalogX CacheBooster is a free tool that is said able to tweak the hard disk cache (never tried it myself), but I'm not sure that it will help, in view of the info below.

As described in Windows Vista Memory Tweak Guide, the disk cache parameters reside in the registry:
HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\SessionManager\Memory Management

Some important parameters are :

DisablePagingExecutive controls how inactive kernel-mode drivers and system code can be released from RAM and paged to the Page File. Unfortunately, you don't have a page file so system code never gets swapped out.

LargeSystemCache controls the size of the file system cache as follows:

  • 0 (Default) a standard sized file system cache is allocated (less than 10MB RAM)
  • 1 enables the use of a large file system cache (up to total RAM amount minus 4MB!)

If this value is zero in your case, then the disk cache is already as small as it can get. If the performance you get is not satisfying, then you must invest in hardware : either more RAM or a faster hard disk. Increasing RAM from 3GB to 4GB will only get you an increase of (1GB - video-memory), unless you also pass to a 64-bit version of Windows.

harrymc
  • 498,455
0

A very annoying pop-up pops up every time when Windows thinks it's low on memory and of course apps crash when the memory is used.

This popup has nothing to do with RAM, and nothing to do with Windows' cache. It means you are running out of commit limit. This is a limit on how much private virtual address space your processes can allocate.

There are three ways to increase your commit limit: 1) run less stuff or smaller stuff at one time; 2) increase RAM; 3) increase your pagefile size. This is because the commit limit is simply the size of RAM plus the current size of the pagefile.

If you would enable your pagefile the way the OS designers intended you wouldn't be seeing these messages and your programs wouldn't be crashing.

And despite what CausingUnderflowsEverywhere said in their comment, sometimes you need a pagefile to allow programs to allocate the virtual memory they need, even though there is plenty of available RAM, and even though the pagefile might not actually be used. For why, see my answers here and enter link description here here.

n.b.: Most of the "cached" RAM reported by Task Manager is still "Available"; the SuperFetch cache does not really "use" RAM. The "cache" is not what's causing your problem. Lack of a pagefile is.