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

Solution 1:

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.

Solution 2:

Windows will have paged the programs out of memory and onto disk. I don't know the algorithm it uses but I wouldn't be surprised if it looked at the length of time the application had been idle.

Windows will be trying to maximise the amount of free physical RAM as that's useful, so upgrading your memory to 8 or even 12GB would improve the responsiveness of your system - especially if you are running several "resource hungry" applications.