Why does Windows use Virtual Memory when I have free RAM?

prowsej

Member
Aug 16, 2001
65
0
0
http://prowsej.no-ip.com/pics/1GBvirtual.PNG

In the picture:
I have 228012K of RAM unused.
I have 185808K of virtual memory (on my hard disk) being used.

This happens almost all of the time: I have lots of unused RAM and Windows is extensively using Virtual Memory. Wouldn't it be faster if Windows maxed out my RAM? Why doesn't Windows do this?
 

Abzstrak

Platinum Member
Mar 11, 2000
2,450
0
0
This is the way its suppose to work, this is the way Microsoft has seen fit to program their memory managment... you are not to question the god of Microsoft....

I completely agree that its stupid, but thats the way it is. There are a few hacks that tell windows to not page the executive, but they make a minimal impact in performance.
 
Aug 27, 2002
10,043
2
0
yep join the club I have 1GB of mem, and used the hack for win98se, it always uses virtual memory, or at least it says it does, my hard drive almost never shows activity, accept for when loading programs, or saving files.
 

bsobel

Moderator Emeritus<br>Elite Member
Dec 9, 2001
13,346
0
0
this is the way Microsoft has seen fit to program their memory managment... you are not to question the god of Microsoft....

Typical useless response from someone who doesn't know whats actually happening.

http://prowsej.no-ip.com/pics/1GBvirtual.PNG
In the picture:
I have 228012K of RAM unused.
I have 185808K of virtual memory (on my hard disk) being used.

Prowsej. From your screen shot you have 384 meg on your machine. You currently have 185meg allocated, which the VAST majority (if not all) is running from physcial memory. Along with the swap file you can allocate upto 1.3 gig on your system (real memory + swap).

I have lots of unused RAM and Windows is extensively using Virtual Memory. Wouldn't it be faster if Windows maxed out my RAM? Why doesn't Windows do this

No, your extensively using virtual memory. From the screen shot sometime during your windows session you where using up to 1.13 gig of memory. Since you only have 384, the rest (not surprisingly) went to swap. You'll have to tell us what you where running that used that much memory, but it was NOT the OS allocating memory for the fun of it.

Bill


 

prowsej

Member
Aug 16, 2001
65
0
0
prowsej. From your screen shot you have 384 meg on your machine. You currently have 185meg allocated, which the VAST majority (if not all) is running from physical memory. Along with the swap file you can allocate up to 1.3 gig on your system (real memory + swap).

I understand that in that screenshot, the total amount of memory allocated (virtual and physical) is 185MB. What I don't understand is why the "PF Usage" bar graph reads "181 MB" as for "The amount of paging file being used by the system." (the definition of what the PF Usage dialog indicates in the help file). Do you see the discrepancy there?

Virtual + Physical = 185MB
Virtual = 181MB

Thanks for the education.
 

bsobel

Moderator Emeritus<br>Elite Member
Dec 9, 2001
13,346
0
0
I understand that in that screenshot, the total amount of memory allocated (virtual and physical) is 185MB. What I don't understand is why the "PF Usage" bar graph reads "181 MB" as for "The amount of paging file being used by the system." (the definition of what the PF Usage dialog indicates in the help file). Do you see the discrepancy there?

Aww, I see what your looking at. That number indicates the amount of swap space used, but 'used' includes space reserved in case it's needed. Generally when an application allocates memory that memory is of a type that can be swapped out to the paging file. So, windows has to put aside a portion of the paging file for that memory *even if it's not currently or will never be swapped out*. Basically it's bookkeeping so Windows doesnt' get into a case where there isn't enough swap file space to properly back what windows has allocated and 'promised' to mange. If another application came along and allocated so much remaining memory that the memory manager decided to swap out your current apps, that 181mb reserved portion of the swap file is where the memory would be swapped to.

That help?
Bill
 

prowsej

Member
Aug 16, 2001
65
0
0
Thanks for the rundown. I understand how it works now and why the numbers don't appear to add up at first glance.

This is what I come to anandtech for - experienced and unbiased help. :D