|
What is Memory and How is it Used?
Your computer is nothing without memory, so it is worth taking a moment to learn how your computer manages it.Todays computers use three types of memory to form a hierarchy, think of it as a pyramid. At the top is the computer's cache, which all data must run through. In the middle is the computer's dynamic random access memory or DRAM for short. The base is comprised of long term storage memory such as; hard disks, flash drives, and optical drives. A good analogy for the way a computer manages its memory would be imagining a student that needs a pen to do his homework.
Cache
Cache acts as a buffer for the processor, since the processor is many times faster then the rest of the computer. This means that when the processor looks for the data it needs, it looks in the cache. If the data is there it fetches it and its put to use, much like the student finding his pen with the first grab into his pockets. If the data is not in the cache, the processor takes a time penalty and has to look in the DRAM. This is the same as that student fishing around in his pockets for the pen and now he has to look in his backpack, he has wasted a few seconds in this search.
DRAM
Since the data is not in the cache, the computer moves to the DRAM or in the students case his backpack. DRAM is used to store the data that is used often or might be useful in the near future because it is much faster then trying to find the data in the long term storage drives. Which is the same reason why a student puts everything he thinks he'll need for class in a backpack. If the data is in the DRAM it fetches it and puts it in the cache so it can be used over again if it's needed. Like the student putting the pen in his pocket after he is done using it, essentially saving it for quick access if he needs it again relatively soon. If the data is not in DRAM, the computer must look in the long term storage devices and this has a much bigger time penalty. In the case of the student, he would have wasted some time looking in his backpack, now he must take even longer asking his neighbors.
Hard Drives, Flash, and Optical Drives
Long term storage can be of many types, with each varying greatly in the time it takes to read or write data. Though no matter which storage devices it is, the read/write time will always be much, much greater then the times it takes to read/write data from DRAM or cache. This is why computer designers try to have as much cache as cost will allow. Since the cost of cache memory (SRAM) is still in the thousands of dollars per gigabyte. It becomes easier and more cost effective to increase system performance by having a system with a fair amount of fast DRAM. If these are overlooked your processor might just end up like a student with small pockets and no backpack, constantly looking around for the things needed to get the work done.