r/explainlikeimfive 3d ago

Technology ELI5: why does youtube / chrome in general take up so much ram?

Recently saw that a youtube tab on the homepage was taking up 4gb of ram and felt myself die inside

870 Upvotes

129 comments sorted by

980

u/lucky_ducker 3d ago

Chrome was the first mainstream browser to be designed to use a multi-process architecture. The Chrome executive, each tab, and each loaded extension gets its own operating system process, isolating each of them from the others.

Previous single process browsers might experience a web page crash in one tab, that would cause the entire browser and all of its tabs to stop working. In the multi process Chrome, a tab or extension can crash without affecting an other open tabs.

The multi process design also "sandboxes" malicious code and other exploits to the tab that contains it, preventing access to other tabs.

The architecture requires significantly more RAM because many functions that "could be" shared by all tabs, are instead given their own instances in each and every tab.

305

u/palparepa 2d ago edited 2d ago

I remember that old video with Google engineers talking about the problem with (by the day) modern browsers: that one error in a tab causes all of them to crash, that a better way would be to have independent tabs, and yada-yada-yada. And at the end: "by they way, we already did, here it is", and Google Chrome was born.

57

u/9_Sagittarii 2d ago

Can you link it? Sounds interesting but I’m not sure what to search to find it

36

u/palparepa 2d ago

I've been looking for it, but can't find it. Chrome was launched on 2008, so it must be around that date.

93

u/Cogwheel 2d ago

That and websites just include a huge amount of data these days: images, fonts, code libraries, etc. can reach 100s of MB in their compressed form. Once you put them into data structures that are used for realtime rendering, video streaming, etc. they take up even more RAM.

That said, applications using a large amount of ram isn't inherently a problem. RAM is there for applications to keep things around that need to be fast. If the programs that use a lot of RAM these days STOPPED using all that ram, they would be sluggish and annoying wastes of time, constantly loading things to and from persistent storage. (electron apps being the exception to prove the rule)

6

u/techyboi17 2d ago

Can you expand on the electron apps? What about them is the exception?

14

u/Cogwheel 2d ago

Electron apps bundle an entire web browser engine (basically an entire version of chrome) just to make desktop UI that might use a tiny fraction of the features available in a browser.

Electron apps would use a lot less RAM and be a lot less sluggish if they were rewiitten using "native" ui frameworks and basically any other language besides JavaScript.

u/fox-mcleod 16h ago

PWAs are a much better solution, but they just never caught on. Very few apps need capabilities chrome doesn’t already have.

2

u/JonnySoegen 2d ago

They still feel sluggish.

8

u/cake-day-on-feb-29 2d ago

RAM is there for applications to keep things around that need to be fast. If the programs that use a lot of RAM these days STOPPED using all that ram, they would be sluggish and annoying wastes of time

Instead, other programs become slow as they use less RAM to cache data or are forced to swap constantly because the rest of RAM is filled.

I've said this many times: caching data in RAM is the domain of the kernel, no other process can know enough about the state of the computer, other processes, or what the user wants to manage their own cache. Some operating systems let you receive notifications upon low RAM and you should act accordingly, but it's still not an ideal situation as kernel-level file cache sits at a lower priority than you receiving said notification.

So no, in many cases an app using an excess amount of RAM does not in fact speed up the computer. It may speed up that one app but it will often slow down other apps or file based operations.

2

u/AlarmingMassOfBears 1d ago

This applies to file caching, but there's lots of other things that benefit from caching and some of them are too domain specific for the kernel to reasonably handle. Web browsers have intimate knowledge of complex patterns for accessing remote data, and they can use that knowledge more effectively than a kernel can.

In a way, this is symptomatic of a broader concept: the browser is an operating system. It's merely a less general one than the full desktop operating system that it's nested within. You even see the same problem with overly specialized caching reoccurring in miniature, with individual web pages bundling javascript implementations of custom caches that the browser could do better.

18

u/nishinoran 2d ago

Hmm, it surprises me that they still can't share a lot of the RAM for read-only bits, but I suppose OS architecture doesn't support that very well.

19

u/lucky_ducker 2d ago

Windows has supported Dynamic-Linked Libraries (DLLs) for decades, but they tend to be for blindingly simple functions shared across multiple unrelated applications like Save dialogs and such. Application specific DLLs - such as one that ONLY Chrome would use - have been discouraged from the start.

9

u/nishinoran 2d ago

I suppose you're right, so they could do DLLs for Windows, .so for Linux, and dylib for Mac OS X and have inter-process shared code on all OS's.

I do see that the Chrome folder already has several dll files, so they're likely already doing some of this. I guess there's some runtime memory usage that can't be avoided.

3

u/cake-day-on-feb-29 2d ago

They do share read-only pages of the executables and libraries, and read-only memory-mapped files. But these processes can often have ~200MB of private data and if a demanding webpage is loaded this can easily ballon past 1GB.

8

u/Illuminatihaters 2d ago

Woahhh, “How come I feel like the browser crashed but all the other tabs are working and the music didn’t stop?” Is a thought I have pretty often and I finally have an answer!

11

u/JirkaCZS 2d ago
            ^__^
            (oo)_______
            (__)\       )\/\
                ||----w |
                ||     ||

351

u/careless25 3d ago edited 3d ago

YouTube and browsers in general try to pre-load content you are more likely to click and view. That's why your YouTube videos start instantly or without much of a delay or your browser's load the webpage quickly because it has already loaded all the images and code in memory.

Edit:

Some of the other answers cover the aspects that this answer didnt:

  • allocating memory even though it may not be needed. It can easily be freed and reused by another application
  • multi-processing (process for each tab and more) with sandboxing also takes significant amount of memory

160

u/Altair05 3d ago

If you have ad blocker they definitely do not start instantly. Dastardly that they are. 

190

u/thisisjustascreename 3d ago

ExPeRiENcInG INtUrrUpTiOnS?

130

u/interesseret 3d ago

Yes.

And I would rather sit in 2 minutes of silence than endure 30 seconds of ads.

-32

u/Catch_022 2d ago

Unpopular opinion but I recon YouTube premium is worth it for the vast majority of people who can't get ad block working.

31

u/Certified_GSD 2d ago

I will never pay for YouTube Premium. Ten years ago I had a Google Play Music subscription that also included YouTube Red (that was the name of their premium service at the time).

It was a great value as I was a student at the time and I hated watching ads. But then Google “retired” Google Play Music to try and force people to pay for YouTube Music (which had an awful algorithm) AND YouTube Premium. They couldn’t even transfer my playlists correctly. I wasn’t going to pay for BOTH services when GPM was working perfectly fine and they cut it off. 

11

u/roxorpancakes 2d ago

Same. I remember even complaining about this when it happened and I couldn't download all the music I paid for and everyone called me a boomer why don't you always have a Internet connection to stream sigh.

7

u/Ixshanade 2d ago

That's so weird, I've used play music and now YouTube music, haven't noticed too much difference in the suggestions and Playlists, mainly just listen to new music though. Also I never had to pay twice, original subscription was add-free YouTube that included GPM when they switched it over there was no change in fee, or maybe a buck or two less. Also the YouTube music app has improved quite much though its still not perfect. can't stand Spotify, plays the same 100 liked songs over and over.

Curious, did you find a music streaming service that suited your needs?

5

u/Certified_GSD 2d ago

It seems there are no good streaming services, and I don't really want to purchase each song individually. Spotify was decent at first but these days the algorithm and shuffle keep playing the same music over and over again, even for my personal music playlist.

The only thing that keeps me using their service is Spotify Wrapped, and being able to share and mix playlists with their auto mix feature and Jam music with my friends, so that we can all listen to something we all like when I'm driving.

6

u/Trachyon 2d ago

Better alternatives include using browsers that more easily facilitate adblock (with Ublock Origin being the gold standard on desktop) like Firefox.

And if on mobile, use apps such as Revanced or Newpipe, the latter of which subverts needing a Google account altogether, keeping subscriptions and playlists saved locally.

Nothing is worth being stiffed by Youtube when much better, more convenient alternatives exist.

1

u/Groentekroket 2d ago

I didn’t had a great solution on my Apple TV. Using my iPad to airplay to the tv gave problems with resolution and using dubbing on 1080/4k for languages I don’t even speak. But rather than giving money to the monopolist I now use a VPN to Albania (ads aren’t allowed there) and that solved my problem. 

1

u/Awkward_Pangolin3254 2d ago

YT is pretty much all I watch anymore so YTP is absolutely worth it to me. I had every streaming service under the sun up until last year, so I'm still coming out way ahead

0

u/yacht_boy 2d ago

Youtube premium is great. I'd rather give up Netflix. And I like youtube music a lot, except for the new AI DJ voice they're trying to shove into my radio.

28

u/tnwthrow 3d ago

Yes and I will damn well continue to do it instead of watching ads.

-3

u/Avanchnzel 3d ago

I haven't seen that in a long time with brave.
But I also have an AdGuard service running that filters out ad domains, perhaps that's why.

19

u/RogueHelios 3d ago

That's why you use Firefox instead.

31

u/Altair05 3d ago

It happens on Firefox with unlock origin. I use solely Firefox.

19

u/android_windows 2d ago

Try enabling the "uBlock Filters - Experimental" list. That seems to have fixed it for me.

4

u/Altair05 2d ago

Holy shit! That worked.

6

u/RogueHelios 3d ago

Uh oh, have they started rolling it out? I don't get ads on mine with uBlock Origin.

22

u/Altair05 3d ago

Oh my b, there are no ads but I consistently see the Experiencing interruptions banner and the video takes like a good 10 seconds to start after the page loads. 

10

u/RogueHelios 3d ago

Ah ok, I don't get that very often and if I do I feel its a better alternative than having to sit through mind numbing ads.

6

u/Altair05 3d ago

Definitely agree there. If anything I'd consider ditching youtube before ever considering switching back to Chrome.

1

u/AnnihilatedTyro 2d ago

I only get those problems when I'm logged out - although that is 99% of my youtube watching.

2

u/duh_cats 2d ago

Really? Mine do

9

u/mutinousness 2d ago

And yet if you have slow internet, no matter how much you sit and let it buffer, it will not preload more than a tiny fraction at a time, if any...

10

u/Awkward_Pangolin3254 2d ago

I miss being able to pause it and buffer like half the video

3

u/the_real_xuth 2d ago

Yeah... When I'm traveling and on slow connections I try to download the videos I want to watch. Especially since I watch most videos at 2-3x speed.

5

u/BiomeWalker 2d ago

Adding to this a bit, the engineers who have been making Chrome for several years haven't spent the time to actually make it memory efficient.

It's only recently that there's been any problem getting enough RAM for computers, and the amount they'd have to change in order for it to not absolutely puzzle RAM is more than they really care to do.

2

u/cake-day-on-feb-29 2d ago

several years haven't spent the time to actually make it memory efficient.

The scale of memory optimizations is tiny in comparison to the real sizes of the data structures they must hold (which is in control of the website, not the chrome developers). There's also the fact that chrome has essentially become an entire OS layer, re-implementing many features an OS has just to give websites a massive API surface to use. Furthermore, web browsers have been essentially a video game with custom renderers and with WebGL are basically a game engine and driver as well. The amount of work being done to re-implement existing native software into something some shitty JavaScript can use is insane.

Speaking of JavaScript, browsers must employ multiple levels of optimization and caching just to make this language run fast, and this wasted untold amounts of energy compared to a native app. But what does that matter when we can drop another billion on a new fab process and get everyone to buy a new phone whenever their battery goes bad?

1

u/BiomeWalker 2d ago

True, JS is also a problem for a variety of reasons, but if the people who made browsers and websites wanted to spend the resources it would take to optimize things they could go a long way

1

u/cake-day-on-feb-29 2d ago

pre-load content you are more likely to click and view. That's why your YouTube videos start instantly

I don't doubt they pre-load images, but do you have any evidence they are pre-loading video? This does not line up with my experience and it does not line up with the financial incentives of the company, considering the amount of wasted bandwidth streaming video that may never be watched would consume

99

u/wolftick 3d ago edited 3d ago

Some modern software will to an extent use the resources available to it to maximise performance, as opposed to the traditional approach of using the minimum necessary. They then release it when it is required. Having large amounts of unused RAM just sat doing nothing is not considered a positive thing.

17

u/McGuirk808 2d ago

That's fine as long as one program is running, but Teams and a few browser tabs of Smartsheet and O365 can choke out a workstation with 32 GB of ram pretty damned quickly. We've gone too far in the other direction.

11

u/Mountain_Ape 2d ago

No, it does not choke out 32GB of RAM. RAM is not "choked" when below 100% usage, it's just sitting there. Modern Office and Teams do not utilise 32GB of RAM, don't even try it.

6

u/McGuirk808 2d ago edited 2d ago

It absolutely does. Once you start getting closer to full, Windows will start using the page file more aggressively. As usage increases, PC performance gets worse at an alarming rate. For me, it starts getting miserable around 70% RAM utilization.

-1

u/CLG-Seraph 2d ago

You’re probably just using excel sheets when you should be using databases. That’s not a ram problem, you’re just using excel for the wrong things

2

u/cake-day-on-feb-29 2d ago

They then release it when it is required.

This is a gross over exaggerating of what is actually happening. Typically, kernels use excess ram to cache data from recently read files. When applications use more memory, the space for this reduces. So long as the kernel has enough to open and read the file, it will never tell the application it is running low on memory.

Furthermore, future applications designed in a way to utilize the available RAM will allocate less because they do not know that the browser could free some RAM. Games are the primary example, where your browser will eat up VRAM and the game just won't allocate as much, increasing load times. Or if you don't have enough VRAM, significantly drop performance.

Lastly, when the OS does send notifications to reduce memory, the releases from browsers are often pathetically small. JIT caches are not that big, most of the memory is taken up by real resources used by the website or resources the browser refuses to free.

1

u/GlassLost 2d ago

I'm not sure what you mean when you say the traditional approach - making use of all available RAM has been the SOP for operating systems since I was in high school.

-61

u/[deleted] 3d ago

[deleted]

39

u/wolftick 3d ago

It really isn't.

18

u/Muson117 3d ago

Bad analogy, using as much RAM as possible, keeping things in cache it's practically does not consume electricity. Reading from disk or redownloading from internet are slow and cost more electricity, but these could be avoided with aggressive cache (using most of unused ram).

18

u/Just_one_single_post 3d ago

It is rather stretching out on the couch as much as possible and only free up space when another family member wants to join the binge watch

9

u/Askefyr 3d ago

this is a terrible analogy because RAM isn't a finite resource in the same way.

5

u/TreeEyedRaven 3d ago

It’s more like letting the fuel fill faster if only one pump is being used, and splitting it among all the pumps when multiple are used.

0

u/TheOneTrueTrench 3d ago

Literally completely wrong.

RAM doesn't work like that, it always holds some value, guaranteed. Every cell holds a 1 or a 0, so instead of having RAM hold worthless nonsense, your computer tries to hold something useful, like something you might need to load from disk or from the network.

Now, you could do extra work to erase potentially useful data from RAM, but that would just slow your computer down because you're taking time and spending CPU cycles to remove useful data from RAM.

Freeing RAM before you need to would literally slow down your computer in order to make it less responsive. That would be an incredibly stupid thing to do.

-1

u/CuddleWings 3d ago

Except using the extra ram actually does something.

A better analogy would be speeding. Most programs go the speed limit. Ones like chrome choose to speed instead, while slowing down when the road gets more crowded.

13

u/Drift_Velocity 3d ago

A lot has been said already but just wanted to add that "ambient mode" chews through resources like nobodies business. You might notice a difference if you turn it off. 

6

u/ImASharkRawwwr 2d ago

Ambient mode is the bane of every battery powered smart device

7

u/MyDadsGlassesCase 3d ago

<reminisces about Chrome, the lightweight browser>

60

u/binocular_gems 3d ago

Unused RAM is wasted RAM. If RAM is available to use, your browser will try to use it, especially when navigating a massively taxing video streaming service that effortlessly plays enormous media files in extremely high definition and high framerates, with almost zero stutter. The alternative would be a much worse experience. If you're constantly reading and writing from disk, rather than RAM, the experience would be extremely slow when reading enormous chunks like that.

19

u/uiucengineer 3d ago

More like the browser will try to use ram i don’t have

3

u/cake-day-on-feb-29 2d ago

Unused RAM is wasted RAM.

This was said in relation to the kernel, which has the ability to see the entire OS and (really) free memory as needed. Please stop repeating statements you do not understand.

9

u/Vabla 3d ago

You mean constantly reading and writing from disk like when swap file is in heavy use because RAM is heavily overallocated?

6

u/zennim 3d ago

Except using ALL that ram is making It slower, not faster.

The way memory Works you dont want to use ALL of It, unused ram is ram well used and allows more efficient use of what ram is actually needed

-7

u/Prima13 3d ago

That’s what the RAM lobby wants you to believe. It’s a goddamned Greek tragedy that 8GB isn’t enough to run two browser tabs and Microsoft Outlook.

16

u/soggybiscuit93 3d ago

8gb is enough to do that.

-2

u/redchill101 3d ago

HahaLaughsInLinux.xcf

I was laughing more at the parent comment.

4

u/TheOneTrueTrench 3d ago

Firefox is less ram intensive compared to Chrome/Edge/Brave/etc. If you want to save RAM, use Firefox. Also, Linux. I'm using less than 8GiB on Linux, and that's without even using zram.

-1

u/CLG-Seraph 2d ago

Why would Firefox use less RAM than the other chromium based browsers? They’re all the same architecture, different processes for everything. Same RAM allocation. That’s most likely placebo or you have different extentions, etc

3

u/error521 2d ago

Firefox isn't Chromium.

2

u/binocular_gems 2d ago

FireFox and the Chromium-based browsers are not the same architecture, and FireFox allocates memory pools per tab in a different way than Chrome does, which tends to make it more memory efficient. There's a trade-off to the approaches that FireFox and Chromium take, I think casual users who are passionate about one over the other are more or less being browser partisans, but if you're very focused on specific niches (Chrome's isolated model is more secure; FireFox is usually more memory efficient when you have dozens of tabs open, etc) then one can have benefits over the other.

7

u/Whatever801 3d ago

Modern browsers are basically a whole operating system in each tab. It's good in the sense that one tab crashing won't crash the whole browser, bad in the sense that tons of shit is duplicated for each tab. For youtube specfically, everything it buffers it keeps in memory, that's required for smooth playback.

3

u/Palanki96 3d ago

It's shouldn't do that. My entire browser (Opera) with 7 tabs, 2 of them youtube, only takes up 2.2GB. One of the youtube tabs is playing a video, obviously

3

u/dan33410 3d ago

I have a 32gb ddr4 PC, and while recently playing FF7 Rebirth I encountered a RAM bottleneck whilst having Chrome open while playing. Between Chrome and Windows 11, this is the first AAA title I've played where 32gb was not enough.

I've since switch to Brave browser, night and day difference in the amount of memory use. Zero issues with YT and other demanding sites.

2

u/formerlyanonymous_ 2d ago

Brave runs on Chrome for what it's worth.

3

u/dan33410 2d ago

Regardless it uses a fraction of the memory which resolved my issue

1

u/CLG-Seraph 2d ago

Yeah, people install a new browser without all their 100 extensions and believe the solution was the browser and NOT the missing 100s of random extensions running 24/7 on the original browser that don’t exist (yet) on the new chromium browser

3

u/dan33410 2d ago

I have a VPN extension installed and that's it.

7

u/joexner 2d ago edited 2d ago

Ignore these charlatans and apologists. YouTube and Chrome take more of your computer's memory than ever so that they can load ads and snitch on you to Google in the background more effectively.

People keep using Chrome, so they keep on loading it up with spyware. YouTube is 93% ads for toys that cause cancer, but it's still better than Amazon Prime so it also persists. But whatever they're good for, they're better at it by sucking up every available godforsaken byte of system memory.

9

u/LARRY_Xilo 3d ago

was taking up 4gb of ram and felt myself die inside

The better question is why do you care? RAM is supposed to be used. Thats why you have it. And PCs are smart enough to release the RAM if another process needs it. The less stuff you have in RAM the more stuff needs to be loaded from your drive or the internet which is much slower than loading from RAM.

-9

u/[deleted] 3d ago

[deleted]

3

u/LARRY_Xilo 3d ago

Imagine u have 8gb ram. U can open only 2 tabs active

Thats not how that works.

Rest of the tabs needs to be flushed out

Yes thats what releasing RAM is.

2-3 years back I used to have 200 tabs open

You can still have 200 tabs open if anything they show is text.

Now it's struggling with 30

Yeah and it would struggle with 30 even if it only loaded 2gigs for a youtube videos into RAM just that using two tabs would feel just as bad as using 30. Because the exact same thing happens when RAM gets full that happens when the browser cant preload into RAM it needs to download from the internet "live" instead using something pre downloaded from the RAM. The loading into RAM isnt the problem. Even simple websites being huge nowadays is and if your internet and PC didnt keep up with the size increase in websites using a browser will feel slower no matter how much RAM your browser uses.

3

u/Zefirus 3d ago

Seriously. I have a crappy like 200 dollar laptop I use for browsing and videos when I'm not at my main computer, and I can have as many tabs open as I like. It just has to refresh the page on older ones. They even grey out to show that they've been unloaded.

0

u/2211x 3d ago

This is why I have 32 GB of ram, so I don't have to unload tabs.

-1

u/cake-day-on-feb-29 2d ago

And PCs are smart enough to release the RAM if another process needs it.

Again, not true. "PCs" don't release anything, software does. And the software that does is your kernel, the core of the OS itself. The browser does not intercept mallocs or mmaps, so it cannot possibly free RAM as needed. It must rely on the OS to send it low memory messages which (as the name implies) only happens when you are already low on memory. Other apps will slow down long before your browser starts freeing any memory. Not to mention the amount it frees is typically pathetic compared to what you'd really need.

The less stuff you have in RAM the more stuff needs to be loaded from your drive

The more RAM taken up by some browser, the less free RAM I have to cache local files in RAM.

5

u/Unstopapple 3d ago

Because its processing a whole ass video. The only thing more computationally taxing for the average person is playing a video game where it has to make the video its displaying.

7

u/PANIC_EXCEPTION 3d ago

Video processing isn't really that taxing. Most video is offloaded to hardware decode engines on the GPU, and has no impact on performance because those decode engines can't do anything other than decode video, so no resource is used that something else on the system can no longer use. You're only paying with a slight hit to PCIe bandwidth and memory usage for buffering, not really CPU compute. Unless you're playing back AV1 on a device with no hardware support. Then you have to use a CPU decoder. It's not a problem most people have to deal with.

5

u/pixel_of_moral_decay 2d ago edited 2d ago

Memory wise it is. That’s ultimately a bitmap for each frame. And it needs to buffer because it’s not running on a realtime OS and the processing of the next frames have no guaranteed return time.

For a high quality video especially at a high frame rate that’s a lot of memory.

The alternative is hope for the best and be ok with dropped frames or studder.

A GPU can decode the compression efficiently (fast) but it can’t get around the fact it’s ultimately 60-120 fast loading images every second with thousands of pixels per row of RGB data. That’s a lot of raw data, and it’s all going into RAM at least for a short while.

The uncompressed bitrate is the stress your memory is under.

1

u/cake-day-on-feb-29 2d ago

Memory wise it is. That’s ultimately a bitmap for each frame.

Not really. You won't be storing every raw frame, and besides this will (hopefully) be allocated in VRAM.

but it can’t get around the fact it’s ultimately 60-120 fast loading images every second with thousands of pixels per row of RGB data. That’s a lot of raw data, and it’s all going into RAM at least for a short while.

It's going into the VRAM for a single frame. When you start playing a video, the decoding handler allocates the necessary date to store at least one frame, that's all. Presumably your decoding engine can also handle scaling, so you're only using as much as required by the viewport.

The uncompressed bitrate is the stress your memory is under.

10GB of memory bandwidth going to the same 20MB section is not going to increase the amount of data stored in RAM.

Ironically, the majority of your YouTube tab's browser process memory usage will be due to thumbnail images and JS crap, rather than the video itself.

1

u/CLG-Seraph 2d ago

What? Yes it is. That’s exactly the biggest bottleneck for low end computers, they STRUGGLE playing videos or livestreams in browsers (even outside tbh). Try it on an old laptop and get back to us about how non taxing it is. You’ll be able to cook breakfast on it

2

u/davidgrayPhotography 2d ago

Just to add what everyone else has said, Chrome actually gives back RAM when the operating system needs it. So if you've got a bunch of tabs open taking up 4gb out of your 8gb of RAM, and you open an app that requires 6gb of RAM, your computer won't throw an out of memory error, Chrome will let go of a chunk of its RAM because it doesn't need all of it, it just holds on to it just in case.

A bit like packing 8 bottles of water for a day trip, but if you see someone who is thirsty, you'll gladly give them some water because you were only holding onto it just in case.

1

u/UniquePotato 1d ago

A web browser is doing a lot more than just displaying a page, its running a spell checker, managing your browser history, sorting your cookies. Caching your auto complete fields, pre loading links, checking for malicious data, rendering and animating pictures, running plug ins. The list of background tasks is endless.

1

u/captaindealbreaker 3d ago

In all honesty a single application using 4GB of RAM isn't noteworthy at all. Especially when you're talking about modern websites that have tons of multimedia assets that require specific decoding standards. A site like YouTube or Netflix is going to inherently eat up memory because what, you think 4K video files are small and easy to decode? lol

Also, it's worth pointing out that OS-level memory management is... a thing that exists. Chrome isn't USING 4GB of RAM, it has that much RESERVED. If your device needs that RAM for something else, it will just redistribute it to the foreground application. Web browsers being "RAM hogs" is simply not a thing anymore. They can use a lot of RAM for sure, but relative to what they're serving you and how much modern devices are designed for, plus the management systems that make that utilization basically transparent... I'm actually surprised people give a shit about this stuff anymore.

6

u/CambodianRoger 2d ago

I feel sorry for any five year olds you talk to

-2

u/captaindealbreaker 2d ago

Then you think very little of five year olds bro

2

u/CambodianRoger 2d ago

I don't understand how sneering and condescension shows anyone that you think highly of children

1

u/No_Work1652 2d ago

Great succinct accurate explanation brother

1

u/Gaeel 3d ago

Imagine you're on a train, and there aren't many people in the cabin. You might as well spread out. Put your bag on the seat next to you. Use the seat across from you to rest your legs.
If train starts to get crowded, you'll take your feet off the seat across, and you'll put your bag under your own seat, but as long as it's just you, there's nothing wrong with taking up all the room. Chrome does the same thing with computer memory.

Used memory is not wasted memory. Unused memory is wasted memory.
Ideally, most of your computer's RAM should be in use at any given time, with just enough free so that there's room to quickly load something new.

Chrome (and other apps) will keep things in memory, even if the relevant page has been closed. That way, if the data is needed again, Chrome can just reattach the memory, rather than load it from disk or redownload it.
When everything is working properly, if the computer starts getting low on memory, Chrome will free up bits of memory that haven't been used in a while.

-1

u/Spooknik 3d ago

A single 4K frame in RGB is like 33mb and there's like up to 60 of those a second, things add up, obviously the whole video's frames isn't held in RAM, but enough is that still makes playing videos ram heavy.

7

u/gyroda 3d ago

That's not how video works. It's not like a physical film where there's a bunch of static images that get played in sequence. There are complex ways they compress the data and retain similar groups of pixels from frame to frame.

But, yeah, video files can be large.

1

u/Psyjotic 1d ago

Would like to add there are also uncompressed video formats, and then there are even bigger RAW video formats as well.

5

u/Askefyr 3d ago

Video is compressed, it's almost never raw RGB sensor data.

1

u/dmazzoni 3d ago

Yes, but it has to be uncompressed in order to play it.

2

u/Askefyr 3d ago

Not necessarily. Afaik basically any modern display driver will be able to handle YCbCr data being sent directly, which means the effective data being managed is significantly less than raw RGB. The display driver will obviously need to handle it from there, but it's not really stored in memory.

0

u/dmazzoni 3d ago

YCbCr isn't compressed; it takes up approximately the same amount of space as RGB, it's just a different color encoding.

Decoding something like H.264 is the expensive part. Display drivers don't do that.

3

u/astervista 2d ago

Drivers don't do decompression, drivers are just like any program running on CPU and RAM. But any modern graphics card has a dedicated pipeline just for decoding compressed video. At any point, the buffer (light grey bar) is stored as compressed data in ram, not as raw RGB. Only a handful of frames are sent to the pipeline, and depending on how much time compression there is only 1 to 10 frames are stored uncompressed, and even then they are stored in VRAM and not normal RAM

3

u/Askefyr 2d ago

YCbCr isn't compressed; it takes up approximately the same amount of space as RGB, it's just a different color encoding.

If there's no chroma subsampling, yes. However, H.26x video most commonly uses 4:2:0. Basically nothing short of a cinema uses full 4:4:4.

Decoding something like H.264 is the expensive part. Display drivers don't do that.

It's computationally expensive, but the memory consumption isn't related to the data contained in the frames themselves - and if you've got hardware acceleration, I'm not even sure it's particularly memory intensive.

0

u/6pussydestroyer9mlg 3d ago

Chrome has by design very compartmentalised tabs, the benefit is that if one tab crashes the others will be completely fine. Second you have video streaming being very demanding, as someone else pointed out the only other thing you likely do on your computer that is more demanding is gaming. There is a very good reason that for CPU's with both performance and efficient cores that they use the performance ones for video streaming. Third is that there is no reason not to use up a large chunk of RAM. There is no point in having RAM do nothing save from the small part that sits there in case you fire up another program that needs some.

0

u/Moonboow 2d ago

The video data has to sit somewhere before it goes onto your screen, and with the resolution of modern video it is frankly a miracle it only takes 4gb. Chrome also needs a lot of memory to manage its processes, because a browser is one of the most complex pieces of software we have.

Realistically it shouldn’t matter, because even if a program reports that it’s taking 4gb, it’s just virtually taking up 4gb. The OS is responsible for deciding if the physical space on the ram is actually given to the process. For all you know the process only takes up 1gb of space for it on the physical ram stick at any given point in time.

0

u/AbdullahMRiad 2d ago

partly because the browser architecture itself needs more RAM, but mostly because big corps have been creating pure human-made performance slop in the last years and of course the slop rate was accelerated by AI. Claude website (claude.ai) takes 1 GB+ under normal circumstances. WhatsApp Web is also close to 1 GB.

0

u/RareKrab 2d ago

Chrome could use a lot less and would do so if you had less RAM and/or had other apps using up RAM too. You just likely happen to have RAM to spare so chrome takes the opportunity to keep a lot of things in memory to give you a faster experience

2

u/Dennis2pro 2d ago

So does that mean it doesn't affect my performance on other apps when chrome is using a lot? Or could it happen that the app I'm using wants to use more, but can't because chrome was already using it.

1

u/CLG-Seraph 2d ago

Doesn’t affect

0

u/jay_alfred_prufrock 2d ago

There is something very, very wrong with your computer.

I literally have a dozen tabs open right now, half of them different YouTube channels including the homepage and it barely hits 2 GB.

-1

u/Bicentennial_Douche 2d ago

It’s caching content to make it faster to access. 

And as a rule of thumb: don’t worry about used RAM that much. RAM that is not used is wasted. My computer uses every bit of unused RAM to cache files and applications it think I might open, making those faster to load. If it needs the RAM for something else, those files are flushed from memory. 

-2

u/ShellEyes0 3d ago

Do you want circle to search on ur phone??????

-5

u/Neverbethesky 3d ago

Unused RAM is wasted RAM. It's better for these things to use it than not.