Why does Win XP insist on using the Swap file when there is ample free RAM?

BernardP

Golden Member
Jan 10, 2006
1,315
0
76
Many times I have noticed in the Performance tab of Task manager that the system cache is being used while more than half the RAM is free. This on my home system (1 Gb RAM) or my office system (512 Kb). A couple of days ago, I was encoding audio files with EAC/Lame and observed the constant fluctuation of RAM and System cache use. Although the sum of cache and RAM in-use was lower than 1 Gb, the computer seemed to prefer leaving two thirds of RAM unused and work with on-disk cache.

It is a matter of curiosity, but I wonder if anyone knows why Win XP has this kind of memeory management and if this is optimal.
 

MrChad

Lifer
Aug 22, 2001
13,507
3
81
1. Task manager is by no means a good way to understand how your system's virtual memory subsystem is working.
2. Pagefiles, virtual memory and all things related to them in Windows have been discussed ad nauseum in the past. You should find some good answers searching through old threads.
 

Brazen

Diamond Member
Jul 14, 2000
4,259
0
0
It's just being a little shy. Give it some time; it'll warm up to the entire 1 GB.
 

Nothinman

Elite Member
Sep 14, 2001
30,672
0
0
Many times I have noticed in the Performance tab of Task manager that the system cache is being used while more than half the RAM is free.

That's good, you want the system cache used.

the computer seemed to prefer leaving two thirds of RAM unused and work with on-disk cache.

System cache doesn't mean on-disk cache.

It is a matter of curiosity, but I wonder if anyone knows why Win XP has this kind of memeory management and if this is optimal.

Totally guessing since the Windows source code isn't available, but I would assume that any pagefile usage while memory is available is a preemptive strike thing, they put some stuff in the pagefile and leave it in memory too so that when memory does become scares they can reuse the pages without having to waste time writing them to disk first.

Because Windows was not programmed to use all Ram as VM.

That sentence makes no sense what so ever.
 

BernardP

Golden Member
Jan 10, 2006
1,315
0
76
Thanks for the info Nothinman. Interesting theory of yours about Window's memory management.

If you could explain a little more what you mean by "System cache doesn't mean on-disk cache". I had assumed they were two terms for the same thing, representing data stored in the pagefile.
 

Nothinman

Elite Member
Sep 14, 2001
30,672
0
0
If you could explain a little more what you mean by "System cache doesn't mean on-disk cache". I had assumed they were two terms for the same thing, representing data stored in the pagefile.

Generally at the OS level anything-cache means things cached in memory. For instsance, on Linux when something is SwapCached it's in swap but it's also still in memory. It's the same preemptive swapping idea I mentioned above. You only want to cache things in places that are faster than their original source, so caching data from memory in the pagefile doesn't make any sense.

But in general I do agree that Windows hits the disk too much in normal operation, it seems to be a lot more than Linux in a comparable system so there is definitely something going on but I don't know what it is and I don't believe it's fixable. The sad part is that Win2K had a much better feel to it and somehow they 'tweaked' it in the wrong direction.
 

Red Squirrel

No Lifer
May 24, 2003
70,256
13,621
126
www.anyf.ca
Yeah I noticed the same with windows 2003. I have a VM on my VMware server and want it to only use ram to minimize disk activity, but it keeps using page file as well.