Take the 2-minute tour ×
Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

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.

share|improve this question
3  
won't decreasing cache also decrease snappiness? –  stijn Oct 8 '10 at 12:07
    
I define snappiness as responsiveness between switching applications. As swap file is already off, all of them are in RAM - lightning fast switch. I'm willing to sacrifice disk I/O speed for it –  Axarydax Oct 8 '10 at 12:45
    
@Axarydax; That's not how it works, disk cache can be dropped straight away, you're not actually losing any RAM at all. If you're getting low RAM warnings, it's not because of that - I ran Vista on 2GB of RAM, and never saw a low RAM warning. –  Phoshi Oct 8 '10 at 17:50
    
@Phoshi - it was because you had swapfile on. –  Axarydax Oct 8 '10 at 19:08
1  
@Axarydax; Perhaps you should turn yours on, then. You can't have both an entirely RAM based system, and run more applications than you have the resources to maintain. –  Phoshi Oct 8 '10 at 22:28
show 1 more comment

2 Answers

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.

share|improve this answer
    
The system is a lot less responsive when using swap file. I have a good laptop, but with hellishly hard disk, and when I have multiple instances of Visual Studio, browser with lot of tabs, VM or two, database management studio, things tend to swap a lot. And switching apps becomes a long wait. Without swap files, everything's instant. That's a win for me. –  Axarydax Oct 8 '10 at 19:03
    
Now you discover a limitation of a swap-less system. If you have multiple Visual Studio instances and several browser tabs, you **need** more RAM than you have. –  Joel Coehoorn Oct 8 '10 at 19:26
    
that's why I'm getting an 8 GB RAM system in a while. I just need to survive on this machine for a while :-) –  Axarydax Oct 9 '10 at 9:37
add comment

By default, Vista x86 will only allow 2 GB of virtual memory for applications. Real RAM is allocated as required for both applications and the system. If one application needs more, for example 3GB, you can increase this by :

bcdedit /set IncreaseUserVa 3072

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.

share|improve this answer
    
The IncreaseUserVa switch controls the virtual memory space allocated to each program. It does not have any effect on the way that the physical memory within the system is handled. That is, this switch controls the amount of memory that individual programs can make use of, not the amount of memory that the system can use. –  Axarydax Oct 8 '10 at 19:05
    
I believe you are wrong : See my edit. –  harrymc Oct 8 '10 at 20:47
    
I still think that Virtual Memory (2 GB or 4 GB) is for each application, not for all of them total. One program can have 1 GB, second program can have another GB, third another GB. I don't need more than 2 GB for each program, I need Windows to drop its cache to allow me to use all of my 3 GB for programs, combined. –  Axarydax Oct 9 '10 at 9:36
    
I think I misunderstood you, so I rewrote my answer. –  harrymc Oct 9 '10 at 12:18
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.