5

I need to know the best strategy to let Windows 7 use 24GB RAM in the most effective way, so it does as few reads from disk drive as possible.

I once read there is some setting in Windows but I can't find it anymore, so what would be the best way to let Windows 7 aggressively load everything into RAM?

2 Answers 2

2

In Windows, this is all about paging.

By default, windows likes to keep a backing store in the page (swap) file for everything in your physical memory. Most of the time this is great for multi-tasking, as it means you don't have to wait for the operating system to page out RAM when you start up a new app and memory is full — that task is already done. This makes further optimizations like SuperFetch (a service that runs in the background to pre-load programs into memory) possible.

The downside is slower load times for items that are not already cached, as the item must be both read from disk to and RAM, and then the RAM written back to disk. In practice, though, the penalty is minimal as Windows will make use of idle or low-demand times on your system for the 2nd part, and the optimizations make the need for this rare. As a side note, linux works the opposite way, and tries to avoid all paging by default.

Your question asks about two things: reducing disk use and pre-loading information into RAM.

  • To reduce disk use in Windows, you can turn off paging by setting the size of the page file to zero.
  • To get windows to pre-load everything into RAM, just make sure that the SuperFetch service is running (it is by default).

Note that these two tasks are largely incompatible. If you use SuperFetch without using a page file, your RAM will get filled up with stuff that is not currently needed. Because this RAM can't be swapped to disk, that RAM will be unavailable to applications and your computer will often be slower, not faster.

If you feel you have enough RAM to keep everything in memory, the thing to do is to turn off both paging and superfetch. Now, you will have to wait for apps to load from disk into memory, but you will have access to all your RAM when you need it. You also no longer have to wait on superfetch to load things for you after your system boots.

2
  • Can you back this up? IMHO, it doesn't make sense for the memory manager to write prefetched data to disk immediately after reading it. Actually, page file shouldn't be touched at all until there is need for it. For example, I have a page file size set to minimum 256MB (and allowed to grow up to 8GB), but it hardly ever grows, even when Task Manager shows >1GB cached. Also, RAM will get filled up with stuff [and] will be unavailable to applications? Why wouldn't preemptively cached pages simply be discarded when needed? They are counted as "free memory" in Task Manager, after all.
    – vgru
    Commented May 29, 2012 at 19:50
  • Superfetch only fills "free" RAM with prefetched stuff (this appears as standby memory in task manager and the like). If the RAM gets needed for something, the superfetched stuff gets evicted. Page file is irrelevant to superfetch; superfetch only populates memory that would be otherwise left free
    – Mark Sowul
    Commented Nov 16, 2012 at 4:00
4

SuperFetch, when enabled, will start preloading all of your most recently used programs into unused memory, up to your memory capacity. With 24GB of RAM, it will act as a ridiculously large "cache" and it'll greatly speed up your performance. However, it will NOT do anything to slow your computer down, since if a program needs space claimed by SuperFetch, Windows will release it immediately and allow the new program to load (SuperFetch operates on a low priority for both memory and disk access).

As for your paging file, a lot of enthusiasts will tell you that you should disable it with large amounts of RAM installed, and I'm sure that some of them get along just fine without it. Microsoft does not recommend running without a paging file, and considers it an "unsupported configuration". If you start up a program that requires a large virtual memory space, you might get an out-of-memory error since the paging file isn't there to absorb the hit. I'd recommend to leave your paging file on it's default settings and let Windows manage it. With 24GB of RAM, it's not likely that anything will get swapped out to disk.

1
  • More critically, an application may allocate memory but not actually write to it. This "empty space" will take up physical memory with the page file disabled (since Windows does have to give out something on request, either physical or page file). That's where the "commit limit" and such come from. Windows has committed such virtual memory to be available to the app, but Windows doesn't have to waste physical memory that isn't being used yet if it can give out page file until it does.
    – Mark Sowul
    Commented Nov 16, 2012 at 4:02

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .