Breaking down cache memory: Why need it when RAM exists? | Technology News

[ad_1]

For PC enthusiasts, one term you’ll hear thrown around a lot is “cache” or “CPU cache.” But what exactly is it? And why should you care about something that sounds so boring? Let’s break it down in an easy-to-understand way.

At its core (pun intended), the CPU cache is a small amount of super-fast memory that lives right inside your processor. It’s like a tiny closet that the CPU can quickly grab things from instead of having to rummage through the much bigger bedroom that is your system RAM every single time.

Every CPU has at least a little bit of cache memory integrated into it. Lower-end chips might only have a few kilobytes, while high-end CPUs can pack multiple megabytes of cache. For example, the beefy Intel Core i9-14900K processor released last year rocks a hefty 36MB of total cache. Mobile chips have it too – Qualcomm’s Snapdragon 8 Gen 3 has 12MB of L3 cache.

The Snapdragon 8 Gen 3 has 50% more L3 cache than its predecessor. (Image: Qualcomm)

So where can you find the cache memory? It’s located between the CPU and the main memory, usually on the CPU chip itself or on the motherboard near the CPU. A dedicated data bus links it up with the CPU.

Why do we need cache when we have RAM?

You might be thinking, “But I’ve got 32GB of RAM on my mean machine, why do I need this silly cache thing?” There’s actually an interesting story behind it. CPU designers have always been about making processors faster, while RAM makers had a different priority – cramming in more capacity.

This created a growing gap between CPU and RAM performance. And for CPU designers, that was a huge problem – because RAM speed is crucial for overall performance in many workloads. So they needed a solution to help bridge that divide.

That’s where cache memory came in sporting the blistering speeds that can help feed data to the CPU cores much faster than querying that slow main memory all the time.

How does cache work?

Computer memory is all about hierarchy, with CPU registers at the top of it since they’re the fastest, followed by cache memory, system RAM, and then slow storage (SSDs/HDDs) at the bottom. It can be roughly agreed that the higher you climb the hierarchy, the fewer bytes you’ll find.

As it turns out, cache memory has a hierarchy of its own too – and it’s quite similar in principle. It’s split into three levels: L1, L2, and L3 cache, each differentiated by their size, proximity to the cores, and access speeds.

Having this hierarchy with a cache closest to the processor means the data it needs most can be retrieved with minimal latency. Now let’s take a look at what this hierarchy looks like.

L1 cache: The first and smallest tier is the L1 cache. This level holds things that the CPU just accessed or thinks it will need soon, so it’s no surprise it sits closest to the CPU and boasts the lowest latency. Each CPU core also gets an exclusive tiny slice just for itself, usually only a few kilobytes big. The Intel Core i9-14900K, for example, reserves 80 KB in L1 cache for each core (it has 24 cores in all).

The Intel Core i9-14900K has a total L2 cache of 32 MB. (Image: Intel)

If the core can’t find something it needs in its L1 cache, it has to look higher up the hierarchy.

L2 cache: L2 cache is the next step up. Often each core still has its own dedicated pool here, but some CPUs do share portions of the L2 between multiple cores. L2 caches are much bigger than L1. But they have slightly higher latency since data has to travel a bit farther from the cores.

L3 cache: The last level is the L3 cache, which is one big shared pool of memory that all the cores have access to. These L3 caches can be massive, relatively speaking, like that 36MB one in the 14900K chip. This tier has the worst latency of the three tiers since it’s farthest away. But having a large L3 is super important for preventing the CPU from constantly having to ask that sluggish system RAM for data.

Data flow between cache levels

So in practice, data flows from the slowest storage (RAM) into the L3 cache, then L2, then finally L1 – getting closer to the CPU cores along the way.

When a core needs to execute an instruction, it first checks its L1 cache. If the data is there, it’s called a “cache hit” and the core can quickly grab what it needs and get to work. If there’s a “cache miss” and the data isn’t found in L1, it looks in L2. Still no luck? The CPU checks with the L3 cache then.

And if by some terrible circumstance the data isn’t anywhere in any level of cache, the core has to resort to painfully retrieving it from that main system RAM – a scenario cache is designed to prevent as much as possible.

The quicker a CPU can find the data it needs in one of those super-fast cache pools, the better its performance will be across all kinds of workloads like gaming, content creation, and more.

Are there any downsides to cache memory?

Like any other thing, cache memory has its downsides too. It takes up a bunch of physical space on the CPU for how little it can actually store. It’s also super expensive – the reason why you see it in such little capacities. But overall, it’s a worthy trade-off that helps keep your system feeling nice and snappy.

© IE Online Media Services Pvt Ltd

Zohaib is a tech enthusiast and a journalist who covers the latest trends and innovations at The Indian Express’s Tech Desk. A graduate in Computer Applications, he firmly believes that technology exists to serve us and not the other way around. He is fascinated by artificial intelligence and all kinds of gizmos, and enjoys writing about how they impact our lives and society. After a day’s work, he winds down by putting on the latest sci-fi flick. • Experience: 3 years • Education: Bachelor in Computer Applications • Previous experience: Android Police, Gizmochina • Social: Instagram, Twitter, LinkedIn … Read More

First uploaded on: 05-04-2024 at 18:29 IST


[ad_2]

Source link

Loading

4 thoughts on “Breaking down cache memory: Why need it when RAM exists? | Technology News

  1. [url=https://auth.indiatoday.in/saml_logout?ReturnTo=https://www.roadbikereview.com/threads/riis-is-back-in-the-game.371245/?post_id=5374893&nested_view=1#post-5374893/]sport[/url]
    [url=http://augustqplgb.blog2learn.com.xx3.kz/go.php?url=https://www.roadbikereview.com/threads/riis-is-back-in-the-game.371245/?post_id=5374893&nested_view=1#post-5374893/]sport[/url]
    [url=https://images.google.es/url?q=https://www.roadbikereview.com/threads/riis-is-back-in-the-game.371245/?post_id=5374893&nested_view=1#post-5374893/]sport[/url]
    [url=http://www.101rental.com/toolkit/redirect.php?link=https://www.roadbikereview.com/threads/riis-is-back-in-the-game.371245/?post_id=5374893&nested_view=1#post-5374893/]sport[/url]
    [url=http://labinsk24.ru/bitrix/redirect.php?goto=https://www.roadbikereview.com/threads/riis-is-back-in-the-game.371245/?post_id=5374893&nested_view=1#post-5374893/]sport[/url]
    [url=http://search.wi.gov.xx3.kz/go.php?url=https://www.roadbikereview.com/threads/riis-is-back-in-the-game.371245/?post_id=5374893&nested_view=1#post-5374893/]sport[/url]
    [url=http://cutcorner.com.ua/out.php?link=https://www.roadbikereview.com/threads/riis-is-back-in-the-game.371245/?post_id=5374893&nested_view=1#post-5374893/]sport[/url]
    [url=http://www.sexblackporn.com/cgi-bin/at3/out.cgi?id=170&tag=top&trade=https://www.roadbikereview.com/threads/riis-is-back-in-the-game.371245/?post_id=5374893&nested_view=1#post-5374893/]sport[/url]
    [url=http://rpvn.net/music/go.php?u=https://www.roadbikereview.com/threads/riis-is-back-in-the-game.371245/?post_id=5374893&nested_view=1#post-5374893/]sport[/url]
    [url=http://www.therisetothetop.com/redirect.php?u=https://www.roadbikereview.com/threads/riis-is-back-in-the-game.371245/?post_id=5374893&nested_view=1#post-5374893/]sport[/url]
    [url=http://www.999sf.com/url.php?url=https://www.roadbikereview.com/threads/riis-is-back-in-the-game.371245/?post_id=5374893&nested_view=1#post-5374893/]sport[/url]
    [url=https://www.t.me/s/worldcasinonet.fj/url?q=https://www.roadbikereview.com/threads/riis-is-back-in-the-game.371245/?post_id=5374893&nested_view=1#post-5374893/]sport[/url]
    [url=http://www.joi3.com/go.php?url=https://www.roadbikereview.com/threads/riis-is-back-in-the-game.371245/?post_id=5374893&nested_view=1#post-5374893/]sport[/url]
    [url=http://www.foreverweightcare.com/DesktopModules/DCAffiliateTracker/Proxy.aspx?Returnurl=https://www.roadbikereview.com/threads/riis-is-back-in-the-game.371245/?post_id=5374893&nested_view=1#post-5374893/]sport[/url]
    [url=http://maikop.ru/bitrix/rk.php?goto=https://www.roadbikereview.com/threads/riis-is-back-in-the-game.371245/?post_id=5374893&nested_view=1#post-5374893/]sport[/url]

    last sport news here!

    sport
    sport
    sport
    sport
    sport
    sport
    sport
    sport
    sport
    sport
    sport
    sport
    sport
    sport
    sport

  2. [url=https://www.piri24.ru/bitrix/redirect.php?goto=https://www.roadbikereview.com/threads/riis-is-back-in-the-game.371245/?post_id=5374893&nested_view=1#post-5374893/]sport[/url]
    [url=http://www.gudarjavalambre.com/sections/miscelany/link.php?url=https://www.roadbikereview.com/threads/riis-is-back-in-the-game.371245/?post_id=5374893&nested_view=1#post-5374893/]sport[/url]
    [url=http://www.seeleben.de/extern/link.php?url=https://www.roadbikereview.com/threads/riis-is-back-in-the-game.371245/?post_id=5374893&nested_view=1#post-5374893/]sport[/url]
    [url=http://stats.buysellads.com/click.go?z=1499&b=370112&g=&s=&sw=1440&sh=900&br=chrome,7,win&r=0.12374930619262159&link=https://www.roadbikereview.com/threads/riis-is-back-in-the-game.371245/?post_id=5374893&nested_view=1#post-5374893/]sport[/url]
    [url=https://cam7.chaturbate.com/external_ab/?url=https://www.roadbikereview.com/threads/riis-is-back-in-the-game.371245/?post_id=5374893&nested_view=1#post-5374893/]sport[/url]
    [url=http://kertai.nl/ivan/cgi-bin/redirect.cgi?url=https://www.roadbikereview.com/threads/riis-is-back-in-the-game.371245/?post_id=5374893&nested_view=1#post-5374893/]sport[/url]
    [url=https://motochas.com.ua/bitrix/rk.php?goto=https://www.roadbikereview.com/threads/riis-is-back-in-the-game.371245/?post_id=5374893&nested_view=1#post-5374893/]sport[/url]
    [url=http://vitones.ru.xx3.kz/go.php?url=https://www.roadbikereview.com/threads/riis-is-back-in-the-game.371245/?post_id=5374893&nested_view=1#post-5374893/]sport[/url]
    [url=http://www.normativ.su/bitrix/rk.php?goto=https://www.roadbikereview.com/threads/riis-is-back-in-the-game.371245/?post_id=5374893&nested_view=1#post-5374893/]sport[/url]
    [url=http://deputat.zt.ua/redirect?url=https://www.roadbikereview.com/threads/riis-is-back-in-the-game.371245/?post_id=5374893&nested_view=1#post-5374893/]sport[/url]
    [url=https://www.hosting22.com/goto/?url=https://www.roadbikereview.com/threads/riis-is-back-in-the-game.371245/?post_id=5374893&nested_view=1#post-5374893/]sport[/url]
    [url=http://www.thejournal.ie/utils/login/facebook/?url=https://www.roadbikereview.com/threads/riis-is-back-in-the-game.371245/?post_id=5374893&nested_view=1#post-5374893/]sport[/url]
    [url=http://s84472.gridserver.com/?url=https://www.roadbikereview.com/threads/riis-is-back-in-the-game.371245/?post_id=5374893&nested_view=1#post-5374893/]sport[/url]
    [url=http://www.ideasfortravels.com/extLinkRedirect.asp?ID=451L71DAW0RDC5RP&url=https://www.roadbikereview.com/threads/riis-is-back-in-the-game.371245/?post_id=5374893&nested_view=1#post-5374893/]sport[/url]
    [url=http://www.google.rs/url?q=https://www.roadbikereview.com/threads/riis-is-back-in-the-game.371245/?post_id=5374893&nested_view=1#post-5374893/]sport[/url]

    last sport news here!

    sport
    sport
    sport
    sport
    sport
    sport
    sport
    sport
    sport
    sport
    sport
    sport
    sport
    sport
    sport

  3. [url=https://images.t.me/s/worldcasinonet.pr/url?q=https://www.roadbikereview.com/threads/riis-is-back-in-the-game.371245/?post_id=5374893&nested_view=1#post-5374893/]sport[/url]
    [url=http://www.revistacafeicultura.com.br/publicidade-new/adclick.php?bannerid=3&zoneid=0&source=&dest=https://www.roadbikereview.com/threads/riis-is-back-in-the-game.371245/?post_id=5374893&nested_view=1#post-5374893/]sport[/url]
    [url=https://www.piregwan-genesis.com/liens/redirect.php?url=https://www.roadbikereview.com/threads/riis-is-back-in-the-game.371245/?post_id=5374893&nested_view=1#post-5374893/]sport[/url]
    [url=https://www.piri24.ru/bitrix/redirect.php?goto=https://www.roadbikereview.com/threads/riis-is-back-in-the-game.371245/?post_id=5374893&nested_view=1#post-5374893/]sport[/url]
    [url=http://www.valosto.com/link/?url=https://www.roadbikereview.com/threads/riis-is-back-in-the-game.371245/?post_id=5374893&nested_view=1#post-5374893/]sport[/url]
    [url=http://youtube-buzz91246.dbblog.net.xx3.kz/go.php?url=https://www.roadbikereview.com/threads/riis-is-back-in-the-game.371245/?post_id=5374893&nested_view=1#post-5374893/]sport[/url]
    [url=https://belantara.or.id/lang/s/ID?url=https://www.roadbikereview.com/threads/riis-is-back-in-the-game.371245/?post_id=5374893&nested_view=1#post-5374893/]sport[/url]
    [url=http://tenzidetailer.cz/redirect.php?url=https://www.roadbikereview.com/threads/riis-is-back-in-the-game.371245/?post_id=5374893&nested_view=1#post-5374893/]sport[/url]
    [url=http://45.192.167.99.xx3.kz/go.php?url=https://www.roadbikereview.com/threads/riis-is-back-in-the-game.371245/?post_id=5374893&nested_view=1#post-5374893/]sport[/url]
    [url=http://infocommiq-catalogs.avnetwork.com/avcat/ctl_externallink.cfm?linktype=rfi_mfrlink&mlc_id=11712&pin_id=8438&newsid=20914&eurl=https://www.roadbikereview.com/threads/riis-is-back-in-the-game.371245/?post_id=5374893&nested_view=1#post-5374893/]sport[/url]
    [url=http://www.mcclureandsons.com/Projects/FishHatcheries/Baker_Lake_Spawning_Beach_Hatchery.aspx?Returnurl=https://www.roadbikereview.com/threads/riis-is-back-in-the-game.371245/?post_id=5374893&nested_view=1#post-5374893/]sport[/url]
    [url=http://frameless.ticketline.com.mt/IFRED.aspx?red=https://www.roadbikereview.com/threads/riis-is-back-in-the-game.371245/?post_id=5374893&nested_view=1#post-5374893/]sport[/url]
    [url=https://maps.t.me/s/worldcasinonet.fj/url?rct=i&sa=t&url=https://www.roadbikereview.com/threads/riis-is-back-in-the-game.371245/?post_id=5374893&nested_view=1#post-5374893/]sport[/url]
    [url=https://hyperion-project.org/proxy.php?link=https://www.roadbikereview.com/threads/riis-is-back-in-the-game.371245/?post_id=5374893&nested_view=1#post-5374893/]sport[/url]
    [url=https://cipresso.ru/bitrix/redirect.php?goto=https://www.roadbikereview.com/threads/riis-is-back-in-the-game.371245/?post_id=5374893&nested_view=1#post-5374893/]sport[/url]

    last sport news here!

    sport
    sport
    sport
    sport
    sport
    sport
    sport
    sport
    sport
    sport
    sport
    sport
    sport
    sport
    sport

Leave a Reply

Your email address will not be published. Required fields are marked *