What is virtual memory and cache memory?
By shilpaum
@shilpaum (1752)
India
February 7, 2007 11:41pm CST
Is RAM only called as cache memory, or its different?If yes,then whaat's virtual memory.
2 responses
@nitin_hec (1096)
• India
8 Feb 07
no cache memory is totally different from RAM. Cache memory is provided by processor and it is low capicity high speed memory. It is between processor and RAM. The program which comes into RAM for furture execution goes to CAche which keep currenly accessed data. and then goes to Processor. Virtual memory is used when RAM is not high capicity. In it We use some space of harddisk as a RAM where we keep some data which could be accessed in near future by RAM. Generally good for Games.
@AJMSmith (112)
•
8 Feb 07
Not strictly true.
There are 3 types of cache on a windows pc
1) The cpu instruction cache holds the next instructions to be executed (and partially prepares them for execution)
2) The cpu memory cache hold often referenced a copy data from memory in a quick to access location to speed access to it.
Both the above may be have muitiple levels of cache (descreaing in speed)
3) Windows also has a file cache that stores information from currently open files to speed acces to the files.
On the other hand virtual memory normally refers to information in the swap file ... moved out of main memory (ram) to free it up for other applicartions. NB both data stored in RAM and the swap file has a virtual memory address ... this is so that the REAL address can be changed without the application breaking. If your swap file usage is high then the purchase of extra RAM should be considered as this should speed up your maching.
1 person likes this
@sensesfail (2251)
• India
9 Feb 07
No the RAM is definitely not called the cache(read as cash) memory.The cache memory is a high speed access memory.This means that it takes very little time to fetch data from the cache memory when compared to the main memory(RAM).So this means that the CPU can save time by keeping recently used data and instruction in the cache memory to increase the speed of the operations it performs.So the cache memory is mainly provided with the processor to speed up its operations.There are two types of cache memories:
1)Instruction cache.
2)Data cache.
And talking about the virtual memory,the RAM(also called main memory) is limited in size, for eg: 512MB RAM.
The RAM is much faster to access than the hard disk.And since the RAM is limited in size the OS creates a virtual memory space in the hard disk ie space that is actually not present in the RAM but imagined to exist.
This helps alot in bring in the data and instruction prior to its execution and also bringing out the unwanted data present in the main memory(RAM).This operation is called SWAP IN and SWAP OUT.This is a very deep topic which i'd love to dig into but due to time constraints i'm cutting it short.The virtual memory concept also gives rise to two main things called the pages and segments.
Pages are just block of data and segements are small parts of the program.
@sensesfail (2251)
• India
10 Feb 07
Thank you! Great discussion by the way.I've rated this dicussion.