Memory
From HelpDeskWiki
You may have heard about different kinds of memory, and wondered what they are. We'll try to summarize them here, with some more details at the bottom.
| Table of contents |
Physical memory
This is commonly known as memory, RAM, main memory, and others.
When you open your computer and remove the memory sticks, what you're holding is the physical memory. Most computers come with an amount of memory which is a power of 2, thus you'll normally see 64 MB, 128 MB, 256 MB, 512 MB, 1 GB, 2 GB, or 4 GB. Systems with built-in video (i.e., the video controller is not in a socket) will use a part of this memory for video, thus you'll lose an amount varying from about 128K to 4M for that purpose, thus, instead of seeing a value of 128M, you may instead see a value of something like 127 MB or 124 MB.
The more memory you have, the faster your system will run, especially if you run applications that want a lot of memory. Adding memory is generally the cheapest way to make a computer run faster. See below for a discussion of why adding memory makes a system run faster.
Paging file
A paging file, sometimes known as a swap file, is a file on the hard drive which is used as an extension of physical memory. If a program wants more memory than there is enough free physical memory to handle, the system searches to find pages of memory that have not been used recently. These pages are then written out to the paging file, and the sections of physical memory that they were in is released for use by the application that wants it. When the program that owns the memory that has been written out wants to use the memory, the same process occurs to bring those pages back into memory.
The size of the paging file can be adjusted, in Windows XP, by going to Control Panel, opening the System icon, going to the Advanced tab, clicking on the Performance Settings button, clicking on the Advanced tab, then clicking on the Virtual memory Change button.
Virtual memory
Virtual memory is the sum of physical memory and the maximum size of the paging file. If you have 128 MB of physical memory and a paging file with a maximum size of 256 MB, then nearly all applications will believe that you have up to 384 MB of memory.
Cache memory
Cache memory is special fast memory that's used to temporarily hold data that's normally in slow memory or on a hard drive. All modern CPUs devote large portions of their die space to cache, in an attempt to minimize interruptions in the flow of data to the CPU. For example, Intel's Pentium 4 Extreme Edition (EE) has 8 KB of memory in the L1 (fastest) cache, 512 KB of memory in the L2 (medium-speed) cache, and 2 MB of memory in the L3 (slower) cache. Non-EE CPUs do not have the L3 cache. The cache triples the number of transistors on the die, meaning that the chip is very expensive to make.
Why adding memory makes a computer run faster
Actually, it keeps it from being any slower than it needs to be.
One problem occurs when the paging file is used; it takes time to write pages out, and read in other pages. When there is more paging happening than actual work, it's known as "thrashing".
The other problem is when there's not enough virtual memory to satisfy all requests; some programs end up having to make do with less memory. In some cases, this can cause the program to crash (if it hasn't been tested well), and in other cases the program may announce that it can't do something. In the most graceful case, the program will perform, but more slowly than normal.
By increasing the amount of physical memory, the paging file gets used less, and when it does get used, it's used more efficiently.
As an example, an HP Pavilion with 64 MB of RAM, running Windows XP, was observed to take nearly 5 minutes to boot. After increasing the amount of RAM to 256 MB, the same computer took less than a minute to get to the same point.
How big should my paging file be?
Most recommendations range from 1.5 to 2 times the size of physical memory. However, see The Virtual Memory Optimization Guide (http://www.rojakpot.com/showarticle.aspx?artno=143) for an exhaustive discussion of the subject.
How much physical memory can a computer have?
In many cases, the limiting factor is the motherboard; you'll need to check the motherboard specs to see what a particular model supports.
Aside from the motherboard, the CPUs have their own limits. Modern 32-bit Intel-compatible CPUs have a standard limit of 4 gigabytes of memory. Intel Xeon CPUs, which are used in servers, support up to 64 gigabytes of memory.
AMD's new 64-bit CPUs have a current limit of 1 terabyte (1024 gigabytes).
IBM's 64-bit G5 CPU, used by Apple, has a current limit of 4 terabytes (4096 gigabytes).
Intel's 64-bit CPUs have a current limit of 16 terabytes (16,384 gigabytes).
The future limit for AMD and Intel 64-bit CPUs is 4 petabytes (4,194,304 gigabytes).
How much virtual memory can a computer have?
Modern 32-bit computers have a limit of 64 gigabytes of virtual memory, although, since Windows XP has a limit of 4 GB per paging file, this limit is difficult to reach without an Intel Xeon CPU. Windows XP allows a paging file on each partition, therefore the limit can be reached by having 15 or 16 partitions, all containing 4 GB paging files.
How much memory can a program use?
Each program can use up to 4 GB of memory, but under 32-bit CPUs, half of that is set aside for the system to use, so each application can use a maximum of 2 GB (3 GB in certain situations (http://support.microsoft.com/?kbid=328882)).
Under 64-bit CPUs, 32-bit applications get the full 4 GB. The memory needed by the system is in the higher memory space that 32-bit applications are incapable of accessing directly.
64-bit applications do not have the 4 GB limit.

