What Is Cache? Full Information

Hello friends, today we will know in the article what is Cache Memory, how does Cache Memory work, and what are types of Cache Memory? So, friends, you must read this article completely so that you get to know everything about cache memory.

              Whenever it comes to computer memory, most people only know about the hard disk, SSD, RAM, ROM, etc. But there are very few people who know about Cache Memory.


    What Is Cache? Full Information

              Cache memory is a volatile memory of the computer which is made of semiconductors and is attached to the CPU. Cache memory improves the performance of the CPU so that the speed of the computer or mobile is maintained. Due to being embedded in the CPU itself, cache memory is much faster than primary and secondary memory, it stores the same data that the CPU needs again and again. Data is stored temporarily in the cache memory, and its storage capacity is also less.


    How does cache memory work:- 

              It is very easy to understand the working of cache memory. You must know that all the applications or programs that we run on the computer are stored on the hard disk. The CPU is not able to directly fetch the data from the hard disk, because the hard disk is very slow, so the data is loaded into the primary memory RAM. RAM is faster than a hard disk but it is not as fast as a CPU.

              The data transfer speed of RAM, and data access time is slow compared to the CPU. Therefore, when the CPU requests a program from the RAM, the RAM takes a certain time to deliver the program, which impairs the performance of the CPU. That's why cache memory is used here. The backup of data or instructions from the RAM memory address is made in cache memory. Therefore, whatever data is needed by the CPU, it checks it in the cache memory.

              If the data is found in the cache memory then the CPU processes the data and if the data is not found then the CPU has to go to the RAM. The same data is stored in the cache memory, which is needed by the CPU again and again.

              That's why you must have also seen that when you repeatedly run a program on a computer and mobile, it loads very quickly, and if you load a program or application occasionally, it takes some time to load.

              So friends, now you must have understood what is Cache Memory and how it works, now let us also know where is cache memory located?.


    Where is the cache memory located?:- 

              Usually, cache memory is present in the CPU chip in the computer itself. Since there are different levels of cache memory, their status may vary from computer to computer. In most modern processors, Level 1 and Level 2 cache memory are part of the processor core. But the L3 cache is either located in the processor or outside the processor in the motherboard.


    What are the types of Cache:- 


    1. Browser Cache:- 

              Most web browsers cache webpage data by default. For example, when you visit a webpage, the browser caches HTML, images, and any CSS or JavaScript files that are referenced by the page.

              When you browse from other pages on the site that use the same images, CSS, or JavaScript, your browser does not have to re-download those files again. Rather the browser simply loads them from the cache, which is stored in your local hard drive.


    2. Memory Cache:- 

              When an application is running, it caches some data in system memory or RAM.

              For example, if you are working on a video project, then the video editor loads specific video clips and audio tracks from the hard drive into RAM. Since RAM can be accessed very quickly if we Compare this to a hard drive, this will reduce the lag when it comes to importing and editing files.


    3. Disk Cache:- 

              Most HDDs and SSDs have a small amount of RAM which serves as a disk cache. A typical 1 terabyte hard drive has 32 megabytes of cache, while a 2 TB hard drive has about 64 MB of cache.

              This small amount of RAM can make a big difference in the performance of the drive.

              For example, when you open a folder that contains many files, the references to these files are automatically saved in the disk cache. Due to this, it happens that the next time you open the folder, then the list of files gets automatically loaded immediately, instead of taking much time.


    4. Processor Cache:- 

               Processor caches are very small compared to disk caches. This is because a processor cache contains tiny blocks of data, such as frequently used instructions, that can be accessed immediately by the CPU.

              Modern processors have an L1 cache which is located right next to the processor and an L2 cache which is located a little further away.

              This L1 cache is the smallest (about 64 KB), while the size of the L2 cache is about 2 MB. Some high-end processors also have an L3 cache, which is larger than the L2 cache.

              When a processor accesses data from higher-level caches, then it has to move the data from the higher level to the lower-level cache so that it can be accessed faster next time.

              Most of the caching happen in the background only, so you do not get to know whether it is happening or not. At the same time, there is only one such cache that you can control, which is the browser cache.

              If you want, you can open your browser preferences to see its cache settings and at the same time you can also alter its browser cache size or if you want, you can also open the cache when needed.

    Conclusion:- 

    Post a Comment

    0 Comments