I'm not saying there's no such thing as software bloat (there is) but the reason that your computer magically always seems to use 80-90% of the ram no matter how much ram you install is that the computer understands empty ram doesn't do anything but ram being used to cache files makes your user experience much faster

this is a good thing! if your computer stopped doing this everything would suddenly feel very sluggish and stuttery!

y'all to be clear "the computer" means both the operating system managing generic caches, and major apps individually managing their own private caches
@0xabad1dea But this isn't the "using 80-90% of ram" we actually experience. The actual is that Chrome (or whatever Electron app) has allocated for its private use (not fs page cache) 80-90% of ram, thereby preventing fs cache from working and making the computer sluggish & stuttery.
@dalias @0xabad1dea what i am reading is "we need electron in the kernel"
@eater @dalias @0xabad1dea but please make it run in a rhino instance. That way you can also benefit from the jvm.

@eater @dalias @0xabad1dea @chucker We have the worst of both worlds already. We *have* chrome (or safari) near the kernel in every major OS and then electron comes along and suggests the OS chrome isn’t enough and we need to stack more chromes like turtles in userspace because you all love chrome so much

“Yo dawg, I heard you like chrome so I boooted more chrome from your chrome so you can chrome while you chrome.”

@max we went from “Microsoft claims they can’t remove the IE engine from engine? Pff, that’s ridiculous” to “sure, the OS needs its engine, but my app is special and needs its own!”
@chucker Yeah Microsoft was probably right but too early that after the internet changed everything the browser was now a core OS feature not a user app and our culture’s solution was to make it both, badly. It’s hard not to wonder if the EU iOS decision is partly dooming us to ten more years of electron’s shadow just as options like Tauri were starting to sell some more apps on using system webviews.

@max sorry for the late reply but I am very confused. You appear to be describing an architecture where the main chrome installation is on a special ultra low layer of existence near the metal, and then additional copies of chrome in electron are not, and it sounds like you think electron is chrome implemented on top of chrome?

I am not aware of any system that works that way. Main chrome and electron chrome are two copies of the same app running on the same level of user space, the only difference is that one is configured to run a single web app in isolation

@0xabad1dea I took some liberties for amusement, it’s not exactly “technically correct” in all cases, but some of the OS level app launchers are web views (or related/derived tech) and it is funny using them to launch electron apps.

The boundaries between “kernel” and “userspace” are fuzzy in the graphical side of the modern OS, especially today when even core functionality is shipped as “apps” for software lifecycle reasons, and the main browser has some light privileges others don’t.

@0xabad1dea Also electron bundles both node and chrome and node is an additional copy of Chrome’s v8 engine, so there is a bit of “chrome in chrome” in electron. In most electron apps they reduce to a single shared v8 lib, but not all electron apps

@max @0xabad1dea

> Also electron bundles both node and chrome and node is an additional copy of Chrome’s v8 engine

Heh. I hadn’t even thought of that.

@dalias I'm not denying it's a problem for you but I am always confused on this point because every time someone says something like "discord is using up 6GB!" I double check mine and it's using 200MB, maybe 300. I don't think I've ever once caught discord using some shocking amount, or microsoft teams which I also hear this about
@0xabad1dea @dalias I've caught discord using 2GB before. Doesn't happen under normal circumstances.
@0xabad1dea @dalias I’ve caught my browsers using startling amounts, but it’s almost always because I’ve got a ridiculous number of tabs open (which I do all the time) and a bunch of them aren’t suspended. A quick quit-and-restart or manual hibernation of unused tabs drops that back down pretty quickly. JIRA Cloud is also an especially awful consumer of tab RAM — if I’ve got a bunch of JIRA tabs open, I guarantee my RAM use will start spiking.
@castillar @0xabad1dea @dalias Atlassian has no respect for their user’s resources, be it CPU, RAM, or time.
@Profpatsch @0xabad1dea @dalias Yup. I’ll say that in my experience, 90% of JIRA suckage in terms of UI and workflow is due to people just not knowing how to set it up properly, or letting bean-counters and micro-managers set up their workflows. However, Atlassian makes it WAY too easy to do it badly, WAY too hard to do it well, and then wastes tons of compute resources in the browser on top of it.

@0xabad1dea @dalias just checked my Firefox process for the Discord tab, and it's holding about 236MB right now, so not that out of line. Element Web is using 743MB tho :(

Running apps in a browser should amortize away some of the overhead compared to electron - browser shares memory mapping of the engine dll/so between processes, and only has a single compositor process for multiple tabs - i'd estimate that could save as much as 150-200MB per app.

(It seems like Matrix clients are inherently memory hungry; Fractal, a standalone matrix client that does not use a web browser engine anywhere in its implementation, hits 800MB for me…)

@dalias @0xabad1dea Do you know which part of Chromium is allocating so much excess RAM? Is there anything in there that is explicitly designed to allocate a high percentage of available RAM?

@0xabad1dea The RAM use thing is an older paradigm from when nobody had enough RAM to run the latest Windows OS smoothly, and applications had to free up memory constantly by pushing active memory to disks.

Conversely, the abundance of cheap RAM in more recent years has enabled certain software developers to become sloppy with their own housekeeping, and just never offload anything.

@0xabad1dea I’ve had many conversations with ops people about memory alerting on my database servers.

“Do you want this alert threshold at 80%?”
“No, I don’t care about memory alerting. Just alert if there’s excess swap.”
“But you also want to know if it’s out of RAM right?”
“If we’re using all the RAM without swap, this means we’re tuned optimally. Just alert on excess swap usage.”

@bedast
Yeah. I even have a category of machines that only have a tiny amount of swap, specifically so I can alert if anything touches it...
@0xabad1dea

@bedast @0xabad1dea one of the most tedious things about running monitoring systems is teaching sysadmins how to properly monitor.

“You have to disable traps, we have a switch port that’s oscillating between on and off 4 times a second, the EMAIL”

“Or you could ignore the email, disable the port and then replace that module with a new one. Once the port is disabled the email volume drops *dramatically*”

We disabled traps.

@0xabad1dea So true. You _want_ your computer to be using its resources. Just not having a queue for its resources.

@0xabad1dea well, if you have 48G of ram your it mostly stay 50% free, 25% in active use and 25% in cache.

Typical workload was a few VS code, 2 chrome profile, firefox and some kubernetes stuff

@0xabad1dea Only if the kernel is doing it with all programs running in a demand paged fashion. When any one app does it, no.

@0xabad1dea thankyou.gif

Also, your browser is making your computer cry mostly because of horrible websites with terrible JavaScript.

@0xabad1dea on #linux, with

% echo 3 > /proc/sys/vm/drop_caches

as root one can experience this hands on

@0xabad1dea I have 64GB of RAM in my computer and sometimes I cache entire ISO files in RAM to the point where when I am flashing or burning them the drive they are on doesn't even spin up!
@0xabad1dea @NanoRaptor
If you're not running at 100% cpu, ram, and I/O all the time then you wasted your money.

@FritzAdalis @0xabad1dea @NanoRaptor

You are then using electric power and have heat to dissipate, so I am going to invoke the sunk cost fallacy.

Besides, you buy capacity for peak use, not for constant use.

@FritzAdalis @0xabad1dea @NanoRaptor

It is, in fact, a bad thing if you have to run your fans at top speed all the time but do not wish to pay for all that energy or contribute it to the global thermodynamic crisis.

@FritzAdalis @0xabad1dea @NanoRaptor It means you spent your money on tuning rather than hardware.

Labor isn’t free either. :-)

@0xabad1dea the thing is: there are much more efficient ways of caching out things than just RAM - and there are certain things that Do Not require excessive caching yet are accumulated in the RAM counterpart anyways. ~1/0.7gb on a idle occasion without anything else being computed other than the interface of an application should Not be a standard in most occasions (development environments as a notable example are an exemption to this rule as they also handle inner logic to make your experience while coding more interactive and intuitive).

the processing unit and the drives storing your tasks can handle a lot of things and under no surprise is how various popular things from the past worked.

@0xabad1dea as for operating system i believe that a lot of the memory consumption boils down to “compatibility with specific models that you may not need but others require to get a stable experience”. NT, which is the kernel i can think that applies this logic the most is a notable example of resource hogging due to this purpose. linux at least manages to handle it quite well because of it’s well-thought expansive modularity, so there’s not that much concern from this part in comparison.
@0xabad1dea I don’t know how but normally Linux never runs into this issue
@3kh0 into what issue? the only issue in this post is misaligned user perception
@0xabad1dea Software bloat on linux (not talking about ubuntu)
@0xabad1dea no such thing as too much ram or too much screen
@0xabad1dea Look, I didn’t compile Gentoo with a bunch of memory management flags just to have to learn about caching. With as poor performance as I’m getting, one of those bloated distros would be even worse! /s

@0xabad1dea my issue is that it seems to fail frequently in ways that noticable affect system performance. I've always assumed it was trying to cache things...but something is off about the priority. When the computer reboots and loads all of my major programs in under a minute, how much more caching do I really need?

On windows systems with 48-64GB of ram I had to reboot once or twice a week because I've had it bog down and appear to use a page file on hard drive (which I wish it never did on SSD). RAM will 90%+ used, but if I tally up individual programs it will be closer to 25%. I assume this is primarily OS then, although individual programs could be aggravating the caching system.

Linux has been smoother and less frequent problems...but I still catch browser suddenly asking for 32+GB of ram and suddenly stuff like X and bash crash from out of memory issues while browser keeps allocating. (I realize this is what I would get if I force no page file...).

@0xabad1dea I speak in past tense as it does seem like has changed in the last year or so. Browsers maybe have gotten better in my personal experience?

Also one big change on work machines was IT removing networking accelerating drivers that came preinstalled. This has zero impact on download speeds, but with accelerator RAM slowly filled up based on how much I downloaded... And was never unallocated and never showed up as used by any particular program. If I downloaded 5-10GB of files, RAM reflected that entirely being cached...and it would still page if I hit 100% usage. So when doing remote work I got in habit of downloading data then rebooting.

@0xabad1dea

always seems to use 80-90% of the ram no matter how much ram you install is that the computer understands empty ram doesn't do anything but ram being used to cache files

I don't know how it works on Windows, but I've never seen caching reported by the OS as memory that is in use. The memory reported as "free" is what is used as cache.

@0xabad1dea

True. But also, your computer can feel very sluggish and stuttery after completing a kernel build for a minute or so. Your load (the kernel build) likely caused the running kernel to drop many cached filesystem blocks from the vfs cache, so it can take a bit of time to page them back in. On modern kit, the user probably won't notice much though due to fast SSD and fast I/O. But, it was defintely noticeable on older kit.

@0xabad1dea I mean mine doesn't seem to reach over 50%, but I have 32GB so I imagine there's diminishing returns on how much of it is used. Still, it's very useful to know this is a thing PCs do, as I wasn't aware of it before.
@0xabad1dea this ram cache should be displayed as such, which most task managers/system monitors do, so if your ram is still being used up, there may be more to the story
@0xabad1dea free! ram! is! wasted! ram!

way better to (smartly) put it to good use instead of sit around using barely any of it and suffering.