9 ms·
If its not caching to disk, doesn't that mean that ram usage will skyrocket? As it is chrome is a memory hog, imagine now with all of those videos in ram....
by greatjack613 7y ago
If its not caching to disk, doesn't that mean that ram usage will skyrocket? As it is chrome is a memory hog, imagine now with all of those videos in ram....
- nilsb 7y agoI tend to have dozens of tabs open at the same time. However, only a few of them usually have video elements and Chrome could probably discard the media cache for all of them - except for the currently active one. My assumption here is that the media cache is mainly used for uninterrupted playback in case my network is briefly unavailable (e.g. when on a mobile network).
- vidanay 7y agoRam is meant to be used. Ram should be 100% utilized
- amirmasoudabdol 7y agoYou seem to be ignoring a very important factor here, energy consumption. RAM usage has a direct effect on battery usage and battery usage is an important factor and selling point these days.
- jarfil 7y agoDoes it? I was under the impression that all the installed RAM got refreshed all the time whether it holds useful data or not.
- fourthark 7y agoSurely not as bad as disk.
- slovenlyrobot 7y agoRAM _capacity_ has a direct effect on energy, usage not nearly much if at all. Hardware has been around to selectively put banks into low power saving mode, but I've never heard of any commodity OS that supported anything like that. It'd require active organization of physical pages to take advantage of, if common controllers even supported it
- sephamorr 7y agoNote that most of RAM's power consumption comes from reading and writing (a function of memory clock speed). Allocating the RAM itself is likely to meaningfully increase power draw, but accessing it will.
- belltaco 7y agoAre there any benchmarks around showing this? And how much extra power draw it is.
- daeken 7y agoThe state of bits in RAM has zero effect on energy usage. Caching things in memory allows for lower power consumption, though, by preventing duplication of effort by the CPU. Edit: Originally said "zero effect on memory usage", which makes very little sense!
- liability 7y agoYes, but if your application assumes that it should use 100% of my RAM, it's being antisocial. Don't assume that I don't have more important software that could be utilizing my RAM in ways more important to me. That's what drives me up a wall whenever people use the "free RAM is wasted RAM" argument; the assumption that RAM unused by your software is unused by me.
- codedokode 7y agoAndroid found a kind of solution for this by agressively killing processes (while saving their state). This seems to be effective because developers are not motivated to help competing applications, they want to have all resources for themselves.
- liability 7y agoThat's perhaps great in android, but you can't/shouldn't write code for Linux/Windows/MacOS, where such a system is not in use, and then protest "I'm not the one that sucks." Maybe those OSes should implement such a system, but until they have the "wasted RAM" argument needs to end for anything other than specialty professional software that can reasonably assume itself to be the raison d'être of that computer (e.g. video editing software, CAD, build systems for large software projects, etc.)
- ferzul 7y agoWindows has such a system with UWP. I think UbTouch or whatever the Ubuntu phone successor distribution is called has one too. And I imagine most systems programmers could define an api if they wanted to. I think this is definitely a case where apps need to be antisocial and operating systems need to peg them in. The age of cooperative multitasking is over. Let the OS decide.
- liability 7y agoHarming users to coerce OS designers is a pretty shitty plan. Sorry if that's too blunt, but that's simply the way I feel.
- codedokode 7y agoI have 4 Gb of RAM and most of time it is utulized over 100%. Not a very pleasant experience with modern Electron apps and reactive HTML5 sites.
- Spooky23 7y agoTry running Office, Chrome and Teams on a constrained system, then say that again!
- detuur 7y agoSpoken like someone who has truly zero understanding of how RAM usage relates to performance. Repeat after me: high data locality reduces the amount of cache misses, which drastically reduces memory latency, and is only achievable through systematic memory usage conservativism.
- nambit 7y agoYou're assuming this person understands data locality, or memory latency or even memory in general.
- neilv 7y agoI've been running Firefox from tmpfs for at least a decade. (tmpfs has more useful properties than letting that RAM go to Linux disk caches instead, in this case.) Firefox doesn't need all that much page/object cache, and videos usually seem to be streamed with transient buffering.
- jarfil 7y agoIf the content is ephemeral then it doesn't make sense to keep it on disk, and as long as Chrome doesn't lock the memory range, the OS will swap it to disk anyway if it needs the RAM for something else.
- codedokode 7y agoWhen I watched high-resolution videos on Youtube with Chrome, its process could take about 400 Mb of memory or even more and swap out other processes. > and as long as Chrome doesn't lock the memory range, the OS will swap it to disk anyway Swapping in/out is random access and is very slow (< 1 Mb/sec) compared to linear reading/writing unless you have SSD.
- nl 7y agoWhen I watched high-resolution videos on Youtube with Chrome, its process could take about 400 Mb of memory or even more and swap out other processes. I've noticed you've said this twice in this thread like it's a bad thing. This is exactly the behaviour I'd expect and want. If I'm watching a video I'd want the system to do everything possible to make it as smooth as possible.
- jarfil 7y agoSwapping contiguous regions is sequential, and Windows will preemptively write non-locked regions to disk so it can instantly discard them when needed. You can force this behavior by dropping working sets, which has the effect of "converting" used RAM to cached pagefile. Of course if you're actively using a program, it will swap out other processes, that's the whole idea.
- codedokode 7y agoIt doesn't make sense to swap out other programs just to load video that will be immediately discarded after displaying. It makes more sense to have limited download and playback buffers and store most of video data on the disk.
- herpderperator 7y agoIf you're playing a video, which is the use case in the article, it wouldn't make sense keep anything in RAM. A minute buffer in either direction seems logical. I am expecting the implementation to be something like that.