Difference Between Similar Terms and Objects

Difference Between Virtual and Cache memory

cache-main-memoryIn the world of computers, memory sets the limit upon which we base if we can run that program or not. If you were unlucky enough to have experienced DOS, then you know the bane of the 640k memory limit. Nowadays memory seems to be almost infinite and nobody actually gets the ‘not enough memory’ messages of yester-year. How did they accomplish that?

The answer to that is a very smart memory management procedure. By placing some parts that should be in memory inside your hard-disk they can extend the memory capacity of a computer way beyond what is installed; this is called virtual memory. So let’s say that your computer only has 1GB of memory and you launch a few programs whose total memory consumption is at around 1.5GB. Without virtual memory, you are not allowed to do that. But with virtual memory, the operating system assigns a portion of the hard-disk as a part of memory and keeps the data there. So in the above example let’s say that the virtual memory is also 1GB. 1GB actual memory + 1GB virtual memory = 2GB system memory. That way even though your memory is limited you can still use memory extensive applications.

There is a disadvantage to virtual memory though. Reading data from a hard disk is substantially slower than reading from memory. So the more information that is stored in your hard-disk the slower your system becomes making it seem sluggish.

Cache memory on the other hand doesn’t extend the amount of memory you have, it merely lessens the amount of time needed to access data. So that you can understand the concept easily, let’s say that the processor is a student doing a report. Whenever he needs data he goes to the bookshelf (the bookshelf being the memory, and the books are the data) and takes out a book and brings it back to his chair. He reads it then he returns it to the bookshelf before continuing with his report. If you were the student it would really be time consuming if you have to stand up and get a book every time you need a piece of data. Practically a student would get a few books from the bookshelf and place it on the table. So that if he needs information that is in the book that he recently used, it is just within arms reach and he doesn’t have to stand and walk to get it.

In this metaphor the table is our cache memory. Whenever the processor uses data it puts the most recent data it used in cache memory for quick access in case it is needed again. Cache memory is very limited though, just like a table having limited space, so data that was not accessed the longest gets returned to memory in order to free up the cache for more recent data.

book-icon Learn more about Cache and Virtual memory.


Search DifferenceBetween.net :

Custom Search



1 Star2 Stars3 Stars4 Stars5 Stars (2 votes, average: 1.50 out of 5)
Loading ... Loading ...


Email This Post Email This Post : If you like this article or our site. Please spread the word. Share it with your friends/family.



See more about : , ,

2 Comments

  1. Fabulous explanation. I love the analogy of the student doing a report. Ben, thanks so much for your contributions to Difference Between.

Leave a Response

Please note: comment moderation is enabled and may delay your comment. There is no need to resubmit your comment.

Articles on DifferenceBetween.net are general information, and are not intended to substitute for professional advice. The information is "AS IS", "WITH ALL FAULTS". User assumes all risk of use, damage, or injury. You agree that we have no liability for any damages.


Protected by Copyscape Plagiarism Finder