Question

  Asked: Feb 15 2006   4:03 AM GMT
  Asked by: Balasaheb


Relation Between Virtual Memory, Cache Memory and RAM???


Data analysis, Data mining/analysis, Data Junction, Microsoft Windows, Data warehousing applications, DataCenter, Hardware, Cabling, Microprocessors, Networking, Routers, Switches, Hubs, Systems management software

Hiii Friends,
Hope so all are doin fine.
Actually i am new in the networking field, can anybody tell the size relation between Virtual, Cache and RAM Memory in Windows Operating systems

Thanks in Advance..

Subscribe to Alerts! Get questions and answers delivered to your Inbox.


E-mail me updates on this question



   SUBSCRIBE

hidden modal window

Answer Wiki (Improve, edit or add to this answer)


 RATE THIS ANSWER
0
Click to Vote:
  •   0
  •  0



Hi,

Ram is obviously where all apps, dll's & other code is loaded included the o/s running but what happens when ram is running low? The o/s has received a request (maybe you just want to open another program) and there is little physical RAM available, so the o/s does what's called paging, where is takes an inactive part of RAM & stores this on disk into a file on windows called pagefile.sys, this data then become virtually stored & the whole state is called virtual memory. A good example of this is say you have a system with only 128MB of RAM, you boot up windows & open task manager, now without any apps running lets say you are using 90MB or physical ram & windows has set aside upon bootup another 128MB of space in the pagefile.sys. OK, so you open word, excel & outlook to do some work, the amount of available memory isn't enough so certain portions of what is running get moved into the page file with priority being given to the new app, so you might find that word which was opened first has now being paged into virtual memory & when you click back to word note the hard disk activity & pause while it loads back the relevant portion into physical memory/ram & pages off something else! so virtual memory allows you to run more programs at the same time but because it requires hard disk access it's slow, for performance you will want to avoid paging completely or as much as possible so you have extra RAM added to your system, virtual memory is basically a backup to RAM memory. You can allow windows to mangage the amount of virtual memory but it might be better to manual set it, I generally use about 2 times my physical ram & also it's a good idea to place the pagefile onto a fast disk of it's own if possible, more likely to be done on servers though.

Cache memory is where something that is likely to be needed again & again is kept to one side, a good example is the Level 1 & Level 2 cache memory on your CPU, the more the better but what is does is hold the most commonly used instructions in the faster cache memory which speeds with processing & therefore performance.

hope this is clear, if not please reply, thanks.
  • AddThis Social Bookmark Button

Browse more Questions and Answers on DataManagement, Oracle and Microsoft Windows.

Looking for relevant DataManagement Whitepapers? Visit the SearchDataManagement.com Research Library.


Discuss This Answer


You must be logged-in to discuss a question. Log-in/Register

poppaman2  |   Feb 15 2006  8:31AM GMT

As you probably know, physical memory (RAM) is a fixed quantity (you add or remove memory depending upon your computers’ requirements).

Cache memory is also physical memory, but is normally associated with a specific device (as opposed to the O/S in general) such as a CPU, SCSI host bus adapter, RAID controller or Hard Drive. Except in the case certain devices such as mid- and high-range SCSI HBA’s and RAID controllers, the cache memory is fixed; preinstalled at the time of manufacture. Cache RAM will usually (bot not always) allow a given system to function faster as it will accept data to be written, transferred or processed and hold it (cache it) at a much higher speed than what can be obtained from the target device. In the case of processor cache, it will hold data pending completion of other operations which will require the held data or in anticipation of it’s use (pre-fetch cache)

Virtual memory is an area of your disk (either logical or physical) which the operating system uses like physical RAM (it actually sees no difference between the two). Of course, this virtual memory, being an area on your hard drive is substantially slower than physical memory (speeds measured in milliseconds, as opposed to nanoseconds). Usually set to 1.5 - 2.0 times physical memory (and it’s a good idea to define the virtual memory or swap file as having a fixed size (min size = max size = 1.5 - 2.0 times physical memory), this swap file CAN be eliminated in certain situations where extreme speeds are desired and there is enough physical memory in place.

For example: A Database Server may have a 0mb swap file (no virtual memory) but contain 2GB - 4GB of memory (or more) per processor. A Graphics Design workstation running Photoshop may have a 0mb swap file because Photoshop uses it’s own virtual memory system.

Determining or “tuning” the size of a swap file is very task dependent and will vary from server to server depending upon the processor speed, physical RAM and the purpose for which the server will be used.

 

FrozenPort  |   Feb 15 2006  10:59PM GMT

Viritual Memory (or a PageFile) is a section of hard disk space that serves like ram

RAM (random access memory) is the physical on your mother board

virtual memory takes most of the load off the physical memory when the physical memory buffer is either busy or overloaded.

i’m not sure what the cache relationship is.

 

solutions1  |   Feb 16 2006  12:15PM GMT

With respect to what you term “size relation,” a rule of thumb is that at each level the cache should exhibit a 90% or greater “hit rate.” That is, L1 cache should fulfill >90% of requests and pass the rest to L2 Cache, which fulfills >90% or more requests, and passes the rest to main memory, which fulfills 90% or more, and passes the remainder to disk-based cache, which fulfills 90% and passes on the rest to non-cached file system/database reads. Overall, what is needed is balance.

As physical capabilities and $ per unit of performance change, you need to rebalance. For example, new PCs and servers typically have bigger L1 and L2 cache than older ones, so you may need to expand memory and disk caches to stay in balance. Also, from a data base performance perspective, some predictable percentage of a given database needs to be cached at the disk level (e.g., 10%), so as a data base gets bigger, caching capability should expand at each leel to maintain balance and throughput.

Therefore what is critical is to have effective performance measurements and diagnosis, and not only of cache utilization. For example, some processes are computationally constrained rather than data constrained, in which case adding more cache is irrelevant.