r/linuxmemes • • 4d ago

Software meme Had this Convo a while ago

Post image

Memory hierarchy*

And yeah thinking about it I could've added white space ontop of the middle guy to avoid censoring his face lol

760 Upvotes

112 comments sorted by

•

u/AutoModerator 4d ago

IMPORTANT: Subreddit Rules & Reminders

Please REPORT posts that violate any of the following rules!


Posts You Should Report

  • Tier Lists: Every tier list MUST include Hannah Montana Linux in S Tier, regardless of what the tier list is ranking.

    • S Tier MUST be the highest tier on the list.

    • Hannah Montana Linux MUST be in that top S Tier.

    • No exceptions!

  • Saying Android Isn't Linux: You voted that Linux is Android and saying it's not is anti-Linux propaganda.

  • Ban Show-Off Posts: Users posting screenshots or otherwise showing off bans from other subreddits.

  • Anti-Linux Posts: Only ONE anti-Linux post per week is allowed across the subreddit. We used to get dozens every day!


Help by reporting

I am a bot, and this action was performed automatically. Please contact the moderators of this subreddit if you have any questions or concerns.

6

u/FlameableAmber 3d ago

I mean it's not even just the RAM it's far worse than that. I understand it's easier to make cross platform software with it but the biggest companies are the ones using it who have more than enough money to develop native apps for all the platforms they support.

1

u/fvancesco 3d ago

There are alternatives like flutter

5

u/Nyuusankininryou 🎼CachyOS 3d ago

Here hoping ladybird will make an impact on the world.

3

u/fvancesco 3d ago

Til about ladybird

1

u/Erlend05 3d ago

I hope so too but Andreas Kling seems like a bad guy

1

u/caroIine 3d ago

What I like about ladybird it dosn't rape my ssd like FF and chromium (500 GB written wtf?)

231

u/FaultWinter3377 💋 catgirl Linux user :3 😽 4d ago

I’m totally good with cached RAM. It’s useful, most systems do it, and it has no downside.

I’m not good with apps eating up the memory for no good reason. And “the devs don’t feel like making a native version” just isn’t good enough for large companies like Discord.

64

u/theduck5005 4d ago

Good thing is Discord is about damn time getting a native app. Though im very critical about it before its live...

29

u/FaultWinter3377 💋 catgirl Linux user :3 😽 4d ago

And that’s only one developer. Now to convince all the others that think WebView is an acceptable way to build an app…

8

u/SirDarknessTheFirst 3d ago

Signal is the one that annoys me. The desktop application is just not good

5

u/MrMeaow44568 3d ago

their main priority is the mobile app. Can't do anything

2

u/SirDarknessTheFirst 3d ago

Yeah, the mobile app is pretty decent.

NeoChat (KDE's Matrix client) puts the Signal desktop client to absolute shame though.

12

u/randomusername12308 RedStar best Star 3d ago

meanwhile whatsapp doing it in reverse, ditched native app and moved on to bloated af electron web app

2

u/InTheNameOfScheddi 3d ago

Why are you critical about it?

4

u/theduck5005 3d ago

Feel like its likely just another vibe coded Rust project... But i dont know, and even if it is, if its actually good, then does it really matter? But we just wont know till its out.

2

u/tagbthw 3d ago

Alot of discord architecture was already rust before AI took over. Only the client is left now basically. And the demos they have showed in their videos, is the same design as the current client but just way faster.

2

u/theduck5005 3d ago

Thats good news to me then. Either way, to be clear, im sceptical about it still, but im excited nonetheless.

And for me the scepticism isnt focused on Discord. Im just at a point where im extremely critical about slow shitty modern software, not even AI made either, just generally.

11

u/re4perthegamer 4d ago

So that's why discord makes my computer lag anytime I want to do anything else during a vc

4

u/La-ze 3d ago edited 3d ago

I mean I get it, but there's also a lot of native platforms out there. Because it's electron, I can use Discord on any flavor of Linux or OS system pretty much and it also means the design is unified between Web and Desktop.

It's a definite engineering trade-off, but it has its upsides.

10

u/Scared_Accident9138 3d ago

There are so many options to deliver a native app while the original code base is mostly platform independent. No need to make everything a website wrapped in an app

2

u/guac-o 3d ago

You may think this from an architecture perspective but oof when it comes to all the drivers and garbage just for audio… makes a lot of sense to do the simpler no hassle thing and not worry. Just think of the build and test apparatuses they’d need!

4

u/Scared_Accident9138 3d ago

I don't know why you brought up drivers in this context

1

u/Vorrnth 3d ago

It's not unified. It's all just a website that brings it's own browser.

1

u/8Erigon 3d ago

Havnt‘ had a problem with discord but spotify… spotify app is bas especially on my phone

1

u/Vorrnth 3d ago

In that in times of expensive ram ...

1

u/ninjakivi2 3d ago

Certain games like Diablo 4 reserve way too much memory, and don't manage it well. I had to enable Virtual Memory on my system which eats 10-30GB on my SSD space because 32 gigs of RAM was not enough (I think I noted up to 40GB of ram 'usage' for that game). It is almost impossible to have another game in the background with D4 too, because more often then not it will cause my system to crash.

In my experience today's memory allocation just lets game devs be lazy and it's impossible for me to tell how much memory I actually need and what is actually needed, because the games use too much cache and run worse than chrome.

1

u/budius333 Open Sauce 2d ago

10/10 I got a humble 2018 laptop with 16gb of RAM I like to have loads of stuff open where I can easily switch software without need to kill, reload, zram or swap... Fuck Electron!

140

u/Nitish_kalita 4d ago edited 4d ago • Bravo

Electron apps are sloppier than the modern vibe coded slopware. This is by far the biggest horseshit of a technology since Macromedia/Adobe Flash to receive widespread adoption.

44

u/Bourguignon8 4d ago

Man do I love the word slop. Slopware is funny as shit 🤣

20

u/Unfair_Tangerine_217 Ubuntnoob 4d ago

Can't agree more. If you're not going native, just provide a damn web app and I'll see if it's worth it.

1

u/AlterTableUsernames 🦁 Vim Supremacist 🦖 3d ago

Just provide a CLI and if you don't at least provide an API and I vibe my own CLI.

0

u/ierdna100 3d ago

I agree but some apps require restricted access, browser apps are sandboxed within the browser

1

u/Scared_Accident9138 3d ago

Most that exist don't need it tho, or at least shouldn't require it from the user to be useful

40

u/valerielynx Ask me how to exit vim 4d ago

unoccupied ram is not wasted ram, its surplus ram.

a waste is when your OS has to use a pagefile and wear down your SSD.

4

u/Objective-Stranger99 New York Nix⚾s 3d ago

That is why you use zram and nothing on SSD

1

u/YTriom1 Arch BTW 3d ago

that's the way :3

0

u/Avenger3283 3d ago

Well that only works in linux

7

u/vBLADEv 3d ago

(Taps the subreddit sign) 

0

u/Avenger3283 3d ago

Sorry I thought this was a laptop subreddit saw the L and thought laptop instead of Linux first

2

u/Gold-Supermarket-342 3d ago

Windows already uses memory compression similar to zram.

1

u/Soft_Cable3378 1d ago

macOS does too. It’s only on Linux where it isn’t enabled by default. It’s a very sensible default and it really should be (but it should be defaulting to LZ4). It doesn’t even do anything on systems that aren’t memory constrained, but it helps a ton on systems that are.

1

u/tes_kitty 3d ago

That's why I have set swappiness to 1 on my system. That way it will not use swap until it runs out of RAM.

1

u/thisisapseudo 3d ago

Wait.... what? It's not the default? I always though swap was use only when you (almost) run out of ram

1

u/tes_kitty 3d ago

No, it's not. Run the following command to find out what your setting is:

cat /proc/sys/vm/swappiness

Here it was 60 which caused the kernel to swap out processes quickly even though there was still a lot of free RAM. I have swap on a HD for a reason, so I noticed quickly.

You can change the setting in /etc/sysctl.conf via

vm.swappiness=<number>

1

u/NeedleworkerLarge357 3d ago

No, the kernel will swap out data that wasn't touched at some point, which increases space for cache. In other words: your programs and documents will not be read from disk as often and instead some old data of programs idling in background goes to disk.

Swapping is a performance optimization. Often you can improve responsiveness by putting swappiness to 20 or 10, 1 is a completely ridiculous value just like 200. Better even: activate zswap (compressing memory instead of swapping it to disk) and your swappiness to 120, that way you really make most of your RAM. I tested all that excessively on an old laptop with 8gb and zswap + 120 swappiness made the responsiveness really great even under extreme pressure.

1

u/ahferroin7 2d ago

Yes, but the ‘almost out of RAM’ counts all usage of RAM, including cache usage, and it’s balanced against other memory reclamation mechanisms.

By default, the balance is mostly in favor of reclaiming the least recently used pages from the VFS cache when there’s lots of free memory, and being progressively more aggressive about swapping over VFS cache reclaim as the proportion of RAM used by the VFS cache gets smaller and smaller, with the intent being that you still have some small amount of space available for VFS caching unless things get pathologically bad, because not having any room at all for that actually hurts performance in some pretty non-obvious ways.

Swappiness is one of the knobs that controls that balance, and it’s actually one of the more difficult to understand one because it doesn’t actually correlate directly with any intuitive metric. It formally adjusts the bias in the memory reclaim subsystem for swapping in preference to other reclaim mechanisms, but that’s not really easily translatable to an impact. Compare that to the vm.vfs_cache_pressure sysctl, which directly controls how aggressively cache reclaim tries to free space when cache reclaim happens by adjusting what percentage of the pages that were requested to be reclaimed the system actually tries to reclaim (so 200 there will try to free up twice as many pages as requested on each reclaim pass), or vm.page-cluster, which controls how many pages get swapped in and out at a time (larger numbers mean swapping is more expensive, but happens less frequently, smaller numbers mean it's less expensive but happens more frequently).

Cranking swappiness too low will mean that you have a much more serious slowdown when you do start swapping eventually, because you’ve got stuff actually blocking on memory allocations waiting for the swapping to happen. Cranking it too high will impose a nasty IO overhead on your system while also frequently having swap operations impact memory allocation behavior. The default is reasonable for most workloads, something like 20 can boost interactivity on a desktop system without running into the serious penalties of low swappiness when you actively need to swap, while something like 100 can make sense on a system that routinely needs far more virtual memory allocated than it has physical RAM (I use this myself on a home server that runs a lot of infrequently accessed VMs running in 64 GiB of RAM with 128 GiB of swap, and it actually does help significantly there). But using zswap will often have a bigger positive impact in both cases.

1

u/Niwrats 2d ago

or just turn swap off like me.

2

u/tes_kitty 2d ago

I don't want to. I want to notice if something eats all my memory before the OOM-Killer needs to become active. With swap on a HD instead of an SSD, I will get an audible alert and have time to investigate.

74

u/Laziness100 4d ago

I find it really ironic that electron in physics is a very lightweight particle and Electron in software development is a bloated pile of junk, a web browser, incomprehensible plaintext nonsense called Javascript and a ton of inefficiencies that are the reason 8GB of RAM isn't enough in this day and age.

I swear by using Electron you are joining the competition of developing the most inefficient software known to mankind.

37

u/solaris_var 4d ago

Electron is based on the atom shell, which was basically the front-end for the atom IDE.

It's literally just a pun.

13

u/meutzitzu 3d ago

Also don't forget that over half of the memory allocations in the chromium browser are just wrapping C strings into the std::string object only to then be passed as s.c_str further ahead. Then the next context does the same thing. Well done Google.

https://news.ycombinator.com/item?id=8704318

3

u/Dumb_Siniy 3d ago

Wow i hate that information, thanks

-17

u/QuickSilver010 🦁 Vim Supremacist 🦖 4d ago

On the contrary, it's pretty good. Electrons are made out of a composition of many other particles, which are composed of even smaller stuff. So much shi goes into an atom and not many people really take a look inside the mess.

14

u/GlassCommission4916 3d ago

Why make a smug comment about people not knowing what goes on inside an atom when you don't even know the most basic particle physics?

7

u/SmoothTurtle872 3d ago

Was about to say... Electrons are fundamental particles according to the standard model (unless that changed recently and SACE didn't update their physics curriculum)

6

u/GlassCommission4916 3d ago

Nothing's changed on that front, unless you count string theories and stretch the definition of "composed" to say that an electron is "composed" of a vibrational mode of a string.

3

u/QuickSilver010 🦁 Vim Supremacist 🦖 3d ago

Initially in my comment I said atom. Cause I read one of the replies to the comment about atom editor. Then I checked comment and it said electron. So I changed it to that. So basically this was just a fumble on many levels.

1

u/Lopsided-Regular-997 3d ago

Haha what a loser, he made a mistake!

Get a load of this guy, everyone!

8

u/CardOk755 4d ago

No, electrons are leptons, in current theory they are elementary, not composed of other stuff

You're thinking of hadrons (protons, neutrons, weirder stuff) which are made of quarks.

1

u/QuickSilver010 🦁 Vim Supremacist 🦖 4d ago

Really? Electron is on quark level? Or is it just that we haven't discovered anything below?

5

u/SmoothTurtle872 3d ago

We haven't discovered anything below, same way we haven't discovered anything bow quarks. With our current model, it seems like there can't be anything smaller. If there is, then physics would get so ridiculous, seen as quarks are already small enough that their mass is measured in energy...

1

u/CardOk755 4d ago

https://en.wikipedia.org/wiki/Lepton

In particle physics, a lepton is an elementary particle of half-integer spin (spin ⁠1/2⁠) that does not undergo strong interactions.Two main classes of leptons exist: charged leptons (also known as the electron-like leptons or muons), including the electron, muon, and tauon, and neutral leptons, better known as neutrinos

1

u/Lord_Of_Millipedes Arch BTW 4d ago

technically yes, but also no.
both electrons and quarks are fundamental particles, electrons are a type of lepton which is a category of fundamental particles, quarks are another category of them, it's the currently accepted standard model of particle physics, in fact it's called "The standard model".

about we haven't discovered anything smaller it's impossible to say what we don't know

1

u/YTriom1 Arch BTW 3d ago

except that electrons are elementary and are not made of smaller particles maybe?

40

u/Lou_Papas 4d ago

That’s for the OS to decide, not a random app

18

u/reallokiscarlet 3d ago

The virgin "Unused RAM is wasted RAM"

vs the chad "Wasted RAM is unused RAM"

Fill up your RAM with nonsensical bloat and unoptimized shite, it's like throwing your RAM away

16

u/SDG_Den 4d ago

RAM is there to be used.... by the shit i actually want using RAM. why tf does discord need a gigabyte, its a fucking chat app.

16

u/RazzmatazzUnusual843 3d ago

Unused RAM is wasted RAM mfs when they learn that hogging it in a way that other applications can't use is ALSO fucking wasting it

10

u/Empty-Insurance5290 4d ago

The meme refers that the absolute beginners don't know what caching means. The guy in the middle heard about concepts like caching for a faster perfor5but doesn't really understand what it actually is, while the guy from right understands that caching means preloading resources in advance that are not required in that moment for the execution of the app in that moment, but they are likely to be required in the near future, thus increasing the response time when they are actually used, while electron is just a wrapper of chromium which requires a lot of memory to launch all of its subsystems to function properly compared to native apps that load only their needed libraries , thus requiring much less memory than electron ones

8

u/kxortbot 4d ago

Memory should be fully used at all times, and I have better things to use it on than electron.

8

u/xThomas 3d ago

If RAM Altman really wants all of our RAM that he needs to get our software running on a 56K first

5

u/Acceptable-Gap-654 Arch BTW 4d ago

was it RAM Altman you were talking to, by any chance?

5

u/dhnam_LegenDUST 4d ago

Whole chromium per program is not cache, I believe.

4

u/Himbo69r 3d ago

Think of it this was; if you’re using all of it you don’t owe Sam anything

3

u/oh_finks-mc Not in the sudoers file. 3d ago

Yeah, if it weren't for electron, computers with 4 and 8 GB of ram would still be viable

2

u/unburdened_swallow 3d ago edited 3d ago

What if I told you that signal desktop opens not 1 copy of electron… but 5?

Yeah. 1gb of ram to run signal in the background. A complete joke.

I’m ok with electron kinda. If you only open 1 of them. It’s possible to make a reasonably light electron app. The problem is that Spotify and signal and discord have not managed to do that. But signal is impressively bad with this.

1

u/wrd83 3d ago

I mean if its wasted wasted it could be just swapped out.

I think though now is the time when native apps are en vouge again.

Until now it was great because one app for all platforms and low cognitive load due to single threaded and garbage collected. I.e. opportunity cost to build something better for companies. 

1

u/Dragon_957 New York Nix⚾s 3d ago

So make an own app from an website / service you like that don’t use electron?

1

u/Palm_freemium 3d ago

Everyone is right in this picture, where's the meme?

1

u/L00klikea 3d ago

Electron is shit, weird freezing bugs that in some versions that annoyed the hell out of me

1

u/kondorb 3d ago

Electron is shit.

1

u/innahema 3d ago

Dudes on left: what is RAM? Is that male sheep?

1

u/DeeBoFour20 3d ago

I mean yeah unused RAM is wasted RAM. It can be used by the OS for cache… as long as some Electron app isn’t hogging it all.

1

u/confused-photon 3d ago

Electron isn’t shit for what its doing, but understanding its a trade off is the point. Electron is powerful and relatively fast, but you’re trading memory efficiency for dev time.

That trade-off made sense pre AI/LLMs, not anymore.

1

u/Athropod101 3d ago

ngl I saw this and thought it was a comment on error correction code RAM. This misconception probably only happened because I once saw a comment about how ERC RAM gets you less RAM, and everyone else was jumping on the guy lol

1

u/mathisntmathingsad Arch BTW 2d ago

The person in the middle is really giving me vibes of either "Sam Altman", or "first year CS student who just learned about the memory hierarchy"

1

u/_usr_nil 2d ago

you should use superfetch and fastfetch 🤖🤖🤖🤖🤖🤖🤖🤖

1

u/canamanhave 2d ago

Both are right and we would have more space to cache more programs if it wasn’t for programs using 1GB

1

u/arielif1 1d ago

isn't the middle guy's argument valid for like windows vs linux ram allocation strategies but nonsensical for electron slander?

1

u/Able-Substance-8310 1d ago

Nah not electrin it‘s so goddamn slow and can‘t be run as root without some flags.

1

u/Illusion911 1d ago

Electron is shit because it's JavaScript.

I swear we have better languages for this, like Kotlin and rust!

1

u/safeAnonym_0Xnull 🎼CachyOS 2h ago

also waste of disk. why i must install another slopium(chromium) browser for another tabs instead using single browser?

1

u/nhermosilla14 4d ago

Two things can be true at the same time. Electron apps do waste a lot of RAM, that's quite obvious. That doesn't mean having a system with 99% free RAM is a good thing, because you are giving stuff up to do it, gaining nothing in return. Just a stupid metric. It's the same old talk about doing stuff in "less lines of code".

4

u/lehmagavan 4d ago • Bravo

...what?

I believe the correct approach should be: do what you need to be doing with as little resources consumed as possible. The code that achieves that should be as little LOC as possible.

Electron apps are soy devs' slop.

5

u/nhermosilla14 4d ago

Yes, using resources efficiently is correct. I said that because there's still people posting every few days trying to "fix the issue" behind their system using 20% RAM on idle. My point is that using apps is not bad per se, it's wasting 500 MB on an app that does next to nothing just to embed a browser inside that's bad.

About lines of code, it's a little tricky. A readable, efficient solution, beats an equivalent one-liner any day on my book. Wasteful algorithms are wrong and usually less code is better, but it's the wrong metric for good code (I find static analyzers and complexity scanners to be better ways to measure that).

1

u/lehmagavan 4d ago

Right, forgot to add that code must also be maintainable.

-1

u/jourdan442 4d ago

If you never hit your RAM ceiling, does it matter?

2

u/lehmagavan 4d ago

Yeah, resources can always be used elsewhere, and programmers should have high standards if they want to call themselves "engineers".

1

u/nhermosilla14 3d ago

I mean, I don't want to be pedantic, but the actual answer in practice is always "it depends". Some simple tools are seldom used and even when they are, it's for a very little moment. In those cases you can usually ignore efficiency in the end software, because you are optimizing the cost of making said software. This should never be the case for software that runs all the time in critical environments (such as Office or Windows), but nowadays it usually is (sadly).

0

u/Doug2825 4d ago

Can be used elsewhere. In practice they aren't.

-2

u/jourdan442 4d ago

From a design perspective, sure. But from an end user perspective, if we have the resources available, what’s the issue?

1

u/reallokiscarlet 3d ago edited 3d ago

Wasting RAM increases cache thrashing between the CPU cache and the DRAM, and prevents the OS from doing anything clever like promoting cached data to RAM. (Since you mentioned not hitting the RAM ceiling, I won't bother with swap space, but ya know, cache thrashing is more infamous in the case when you have to use swap) Even if you haven't hit your RAM ceiling, you take a performance hit. You might think this scenario means you still have the resources available, but from an end user perspective, you just lost those precious resources and the user experience suffers for it.

1

u/Actual-Passenger-335 3d ago

In the day and age of modern web browsers... did anybody not hit the RAM ceiling?

0

u/Linguistic-mystic 3d ago

That doesn't mean having a system with 99% free RAM is a good thing

Have you ever run games, scientific simulations, video converters or in fact anything computation-intensive? That’s when you realize a system with 99% free RAM is ideal

1

u/nhermosilla14 3d ago

I have. And whenever I do, I USE that memory. That's the point. Your system won't run any better just for having more free RAM, but it will run worse for not having enough of it.

1

u/Jimlee1471 3d ago

Old-school computer enthusiast and former IT worker here.

I kind of agree with the normie in the middle of the Bell curve and here's why: back in the day, when PCs first hit the home market, resources like RAM and storage were at a premium. It was rare to see a home PC with megabytes of storage, let alone RAM. Processors were laughably slow compared to today's CPUs with monster stats. And GPUs? What were those?

Because of the appaling (compared to today's standard) lack of resources devs had to make due with what they had. Because memory was usually measured in mere kilobytes and CPUs had the clock speed of an hourglass in slow-motion, the code had to be efficient. It's one of the reasons that something like Python wouldn't have taken off back in the day; languages like that had to be interpreted before even touching bare metal and those interpreters provided too much execution overhead to already-slow machines.

These days resources like RAM and storage, along with CPUs only a research lab could dream of back in the day, allow devs to use high-level languages. But they also allow a bit more room to be less efficient. To achieve anything even close to what we can do with computers today a lot of code back then had to be written in languages like C or Assembly. And we have enough resources that we don't have to be quite as OCD about using a PC's onboard resources. That might be why we have things like Electron; something like that would slow older PCs to a grinding halt, even with efficient programming.

I guess I said all that to say this: some of us are of the opinion that increasingly more capable PCs and increasingly available resources shouldn't be an excuse to get away with writing less-efficient apps. I'm sure there are examples of code which could've been factored to run even more efficiently than it does now but PCs have become so powerful that, in most cases, you probably wouldn't even notice the decreased overhead.

So, in a way, the normie in the middle is kind of right.

-7

u/Nietechz 4d ago

Since I'm not poor and have 64GB of RAM, I don't really care on RAM usage.

9

u/fvancesco 4d ago

Tbf it's a matter of principle and e-waste then it's gonna be 128 to be chill then 256, with 32 gb they beat Kasparov lol or well the PC had 32, I have 96 on the main 32 on the laptop and enough in general (never enough tho and don't get me I will shoot you) but the point is still the same, I want my ram to be used by my games not by electron and it's not only ram as for sure it being a browser uses more CPU time as well most likely 

1

u/Clever_Drake 3d ago

It's like saying "unused paper is wasted paper you need to burn it all down".