This is topic Virtual memory in forum Books, Films, Food and Culture at Hatrack River Forum.


To visit this topic, use this URL:
http://www.hatrack.com/ubb/main/ultimatebb.php?ubb=get_topic;f=2;t=048755

Posted by 777 (Member # 9506) on :
 
So, I just noticed that my computer uses a fraction of its hard drive as RAM. This, it seems, could be very useful. Since my computer has a standard RAM capacity of 512MB, does this extra 768MB actually bring it up to a full 1280MB of RAM? Or am I just misunderstanding this entire 'paging file' deal?

'Cause this could be my ticket to seeing a game of Supreme Commander on my 3-year-old desktop. [Big Grin]
 
Posted by brojack17 (Member # 9189) on :
 
You can configure up to (I think it is) 4x the amount you have in RAM. It is slower than RAM but will work the same way.

We used to have to do that all the time in CAD, but now that the computers are more powerful, not so much.
 
Posted by lem (Member # 6914) on :
 
Your hard drive is VERY slow compared to RAM. So slow that if you try and use your hard drive as RAM it chugs your computer to a stand still.

How it works is this: Your processor is fast, Hard drive is slow, and RAM is fast. Your HD loads information onto RAM and your processor works with RAM at a nice speed. Your HD just holds information.

Here is what virtual RAM is for. Your OS sets aside a part of your HD for virtual RAM. It is functionally not good for RAM. It's purpose is for when you have multiple projects going on and you use up your RAM. If you have a project (IE document) that you haven't used in a while, the computer moves it from RAM into Virtual RAM so that your RAM has more room for projects you are actively working on.

If you click on your word document, your computer chugs some as it moves it off of the HD and back onto RAM and "swaps" it with some other file.

In short, paging files (virtual ram) does not help very much. If your HD could act as RAM, then there would be no need for RAM because HDs have gotten so large. Heck, I would put 80 gigs of virtual ram on my machine no problem--but the operation of any particular program is still mostly/only using RAM.
 
Posted by 777 (Member # 9506) on :
 
Blast.

Ah well. I wasn't expecting too much from it, really.
 
Posted by NotMe (Member # 10470) on :
 
Some more details if you care:
The access latency is the delay from when you ask for a block of data and when you start getting the data. For hard drives, it is an average of about 12ms. For computer RAM, it is a few nanoseconds. If your computer is only waiting a few nanoseconds, you won't notice. What you will notice is if your computer spends 12ms waiting for the hard drive, followed by 1ms of computing, repeating constantly.

What virtual memory does is make the application unaware of whether it is in RAM or on the hard drive. The app can pretend that your machine has all the RAM it needs. The virtual memory system ensures that the necessary portions of the virtual memory space are in RAM when they are needed. This is great when you have a lot of applications or files open: they don't have to compete for RAM. The active program will be moved into RAM, and the inactive programs will be "swapped out" to the pagefile, if needed. All this is done transparently by the operating system.

Where this doesn't help is if one app is manipulating a very large chunk of data. This is called the "working set" of the application. Imagine having a really big image loaded into Photoshop. If the image is too big to fit in your RAM, part of it will be paged out. When you apply a filter to the whole image, it will first be applied to the part of the image in RAM, then that part will be moved to the pagefile, and the rest of the image will be loaded into RAM, and the filter will be applied to that part. Obviously, the larger the working set compared to the RAM, the more times the hard drive will be accessed.

It is a fundamental limitation that, once the working set exceeds the size of RAM, the overall performance is limited by the slowest part: the hard drive. In other words, you might as well not have RAM in the first place. The speed of the RAM is almost totally irrelevant.

Since you have 768MB of swap space and 512MB of RAM, a program can use up to 1280MB of memory. However, if it uses much more than 512MB for itself, the whole program is likely to slow down a lot. For games, the working set can be very big (keeping track of hundreds of objects and their graphics) and games just aren't playable if they are making heavy use of swap space. If you were to run a game that uses more than 512MB of RAM, it wouldn't necessarily crash, it would just run like molasses. You mentioned Supreme Commander. Note that this takes up about 10GB of hard drive space. Already, it is written to only keep in RAM what it really needs. When they say that it needs 512MB of RAM, that really means that the game would be unbearably slow with something like 450MB of RAM.

(On most PCs, an application can use at most 4GB of memory. Any swap space beyond that will only help if you have multiple programs running. 64bit computers raise this limit a lot, but most consumers aren't yet running programs that use more than 4GB of memory.)
 
Posted by lem (Member # 6914) on :
 
quote:
(On most PCs, an application can use at most 4GB of memory. Any swap space beyond that will only help if you have multiple programs running. 64bit computers raise this limit a lot, but most consumers aren't yet running programs that use more than 4GB of memory.)
It should be noted that 32bit XP professional, while claiming to be able to utilize 4GB of Ram only recognizes 3 GB. I have yet to hear a satisfactory answer with what happens to the other 1 GB.

The three most common answers I hear is that: 1: you can't use it, so it is a waste. 2: It is using it but you just don't see it in the GUI. 3: It is being used for hardware and behind the scenes processing but not for "applications."

By the way NotMe, [Hail] That was a much better post then mine!
 
Posted by Earendil18 (Member # 3180) on :
 
Good info guys! [Wink]
 
Posted by Icarus (Member # 3162) on :
 
Fascinating, and very cogently explained--by both of you. [Smile]
 
Posted by brojack17 (Member # 9189) on :
 
Yeah, I never really understood HOW it worked, I just know we used it.

Very clear now.
 
Posted by lem (Member # 6914) on :
 
I found this article today and it reminded me of this thread.

It actually relates to the 3GB vs 4GB of ram in XP that I mentioned in a previous post in this thread. It is the best article I have seen on the subject.

quote:
As more and more of us load up our systems with lots and lots of RAM, this question surfaces more and more. You put 4GB in your computer. The motherboard supports 4GB, Windows XP supports 4GB, so everything is fine.

But when you open the System applet in Control Panel, WinXP tells you that there is 3.5GB, or maybe 3 GB even. Where did the rest go?

The article goes on to address what is going on.
 


Copyright © 2008 Hatrack River Enterprises Inc. All rights reserved.
Reproduction in whole or in part without permission is prohibited.


Powered by Infopop Corporation
UBB.classic™ 6.7.2