Windows – Why are apps so slow initially when switch to them, even though I have free RAM

memoryperformancewindows 7

On my Windows 7 (64-bit) PC, when I have a few resource hungry programs going, and half a dozen others, when I switch to an app that I haven't used for a while, it takes a long time to respond and I can hear the hard drive working a lot. I assume it's getting data from the page file. In Windows Task Manager it shows that I'm using about 75% of physical RAM, with the rest split about 50/50 between cached and free.

Even though RAM is available, has it moved data out of RAM to be only on disk? How can I make other programs more responsive? Will upping my RAM from 4GB to 8GB speed this up when switching from one program to another?

Best Answer

Windows has to make a tradeoff between throughput and latency.

If it kept applications in RAM, even when they hadn't been used for a long period of time, throughput would suffer. The used, but idle physical RAM would reduce the RAM available to other applications and the system.

Windows makes the decision to page out memory that has not been accessed in a long time. This allows more physical RAM to be used as a disk cache, and it significantly improves application throughput.

The tradeoff is that when these applications eventually do need to access the memory pages that haven't been accessed in a while, they may not be resident. In this case, the application has to wait for a moment as they are read back into RAM.

Windows generally does a very good job of making these tradeoffs, and I wouldn't recommend trying to tune it too much. You can make the latency better, but there will be a huge penalty to throughput and, worse, you can get into a state where some things just don't work. (For example, if you disable your paging file, two months from now you may find you're editing a large image or something and are simply unable to save it because the memory allocations always fail.)

Of course, you can always add more RAM. It's absurdly cheap right now. And that makes it less likely that Windows will have to make any tradeoffs in the first place.

Related Question