The cache represents information that is temporarily stored in a computer. Here we will teach you from the meaning of this important unit to how to erase the data contained in it. what is cache memory in computer
What is cache Memory in Computer
Basically, the cache is a fast access memory, whose main function is to keep at hand the data that is expected to be used promptly by the central processing unit (CPU) to complete short-term tasks. This is also done in order to reduce the waiting time in the search for information from the main memory (RAM: Random Access Memory).
There are three types of cache : disk, track, and web cache. However, in this article we will refer to it simply as a computer cache .
Here are some of the main aspects that characterize the cache :
It represents the smallest, fastest, and highest cost tier of all the tiers involved in the memory hierarchy system.
Stores data and program instructions at high speed.
It is faster than RAM, but slower than the central processing unit. Therefore, it generates a state of equilibrium, improving the performance of the system and, therefore, that of the computer.
It consists of two dimensions, the first of which is constituted by the main memory data blocks with the highest accessibility, and the second by their degree of associativity.
The cache works very similar to the central processing unit, but performs its functions more quickly, although it is smaller in size.
As we have already mentioned, the cache memory is responsible for looking for the information that is required by the central processing unit, without it having the need to go to the RAM memory. Thus, the general operation of the cache can be described as follows:
First, the central processing unit manages the instructions that come from the programs. This is possible thanks to the use of complex algorithms. This information is then loaded into RAM and from there it is transferred to the processor.
However, to increase the efficiency of the central processing unit, the most relevant and usage information is recorded in the cache , and not in the main memory. With which the performance of the system is improved, since it is not necessary to travel greater distances to retrieve the information that the CPU requires.
This is due to the fact that the cache memory is located between the RAM and the CPU, thus constituting the closest level to the processor within the memory hierarchy system.
In this regard, it is important to mention that, initially, the cache works in two phases known as Level 1 and Level 2. The first of them is smaller, but with faster access. While the second behaves in the opposite way.
The initial search is done on the first level, which is closest to the CPU. If the information is not there, the Level 2 cache is used . This is still faster than searching RAM.
Now, due to the evolution of technology, current processors have an additional level, which is known as Level 3 cache . There are even computers that have a fourth level, but as it is not usual, we will not enter in detail about him. what is cache memory in computer
Thus, when the program is running, the information is stored in RAM, from there it goes to level 3 cache, then level 2, until it reaches level 1 memory.
Similarly, while the program is still running, the central processing unit tries to find the instructions and data in the cache closest to it, that is, in the level 1 cache. level 2 memory, and finally to level 3 cache. what is cache memory in computer
If the search is unsuccessful in the three memories involved, the processor necessarily goes to the RAM. Unfortunately, the greater the distance you have to travel to access the information, the longer the response time. Which ends up negatively affecting the performance of the system.
The following are the characteristics of each of the levels into which the cache is divided from the point of view of its operation:
L1 cache what is cache memory in computer
Refers to level 1 cache , also called internal memory. Stores the data most used by the central processing unit. Because it is located closer to it, this type of memory is the fastest of all, but also the smallest.
Basically, it contains the specifications of the operations to be carried out, as well as how to execute them.
This memory is second in size to cache 1. However, what it gains in size it loses in speed. It is the second information search unit, when it is unsuccessful with the L1 cache.
In early computers, like level 1 memory, it was installed on the motherboard. It is currently located within the same processor chip.
Finally, it contains the data and instructions that programs need to run quickly.
L3 cache what is cache memory in computer
It is a memory shared between all the cores of the central processing unit. Due to its location, it is at a lower level than the L2 cache with respect to its proximity to the processor and its speed, but at the same time it turns out to be the memory with the highest capacity, while still being faster than RAM.
At this point it must be clarified that it is possible to transfer information between the three levels. In this way we can speak of two types of transfer:
Inclusive: the cache of origin of the information keeps a copy of it once it is transferred to another level.
Exclusive: the requested information is deleted from the provenance cache when it is transmitted.
Writing process what is cache memory in computer
So far we have only referred to the information search process. However, the cache also performs the corresponding write process. Which we will describe below:
This process is quite simple, because instead of writing on the RAM memory, it is done directly on the cache memory. This is possible thanks to the existence of write policies, which are a way to ensure consistency between the two types of memory, even when updating through write operations. The following writing policies are in place:
Write – back: It does not require updating of the RAM memory, because when the information needs to be transferred from the cache memory to the main memory, it does so directly without losing the coherence between both memories.
Write – Through: Requires continuous access to RAM each time a cache line is written. As the RAM memory is constantly updated, the performance of the writing process decreases.
Clearing the cache what is cache memory in computer
One of the factors that usually influences computer performance, as well as processing speed and access to information, is the accumulation of files in the cache . Therefore, it is advisable to do regular cleaning of it, but without abusing the frequency with which they are carried out.
On this point it is important to note that not all the information stored in the cache can be erased, for example: passwords, downloaded documents, settings and conversations remain, while the history of the pages visited, as well as the information which was accessed through passwords is deleted.
Here’s how to clear cache : what is cache memory in computer
The first thing to do is go to the Windows Start menu, and in the search box located in the task panel, we look for Disk Cleanup.
The next screen shows the options regarding the files that can be deleted. We mark the box corresponding to Temporary Internet files. what is cache memory in computer
Then we click where it says OK. The system immediately starts scanning and deleting the files located in the cache. When finished, it shows us a message of completion of the process.
Another way to clear cache is by running a command. This consists of pressing the Windows key plus the R key (Win + R) to bring up the Run menu. Inside it, in the Open bar, we write the letters Cmd and click OK. what is cache memory in computer
In the next window we execute the DNS cleanup command, typing: ipconfig / flushdns and pressing the Enter key.
Now the only thing left is to wait for the procedure to finish on its own, after which the system automatically restarts with which the changes are saved and we are ready to continue.