Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

Unused RAM is wasted RAM. And swap usage is not an issue either unless there's a lot of swap in/out happening.


> Unused RAM is wasted RAM

A terrible phrase constantly used in defense of bloated, wasteful programs using gobs of memory to achieve nothing.


Indeed. They can’t know what other applications you need to run. So they more frugal the OS and application, the more available for other software apps.


It’s true unused it wasted but unfortunately what it’s used for is decided by corporate flavor of the month so garbage one drive, teams and Gemini builds eat all the ram that would be better used by other applications people actually like


I was quite surprised that this phrase, which papers over nuances in how operating systems classify and manage memory, was posted by someone who studied CS.


Please educate yourself how this is false https://www.linuxatemyram.com/


> Unused RAM is wasted RAM

This applies to caches, and it applies to time versus memory tradeoffs in expensive algorithms. Win11 wastes a lot of memory on neither.


If I’m encoding video or running a database, sure.

But the OS should be as lean as possible because the entire reason is to run other programs.


The windows kernel is smart enough to free RAM for the highest demanding app like rendering or video editing, even if the idle is high.

That's why there's no accurate 1:1 comparison between operating systems. Windows, MacOS, and LInux will treat physical memory very differently bot at idle, and during heavy use.

Sure, Win 11 has a lot of bloat and poorly coded Web apps that should be removed or rewritten in native, but the kernel is still top notch at managing even limited memory and handling OOM cases.


The thing with windows is that there is no idle state, something is always busy with the CPU/hogging ram. With Linux I can have like 98% idle and the system taking 2Gb out of my 8gb of ram, but with windows, the system is more like 30% cpu and more than 4GB of currently being used ram.


If idle on Win 11 already pre-caches most-used apps like Chrome/FF and not on Linux, how can you accurately measure what true idle is?

You have to remember the Win (and MacOS) kernel is tuned to consumer desktop user use cases, while Linux kernel is tuned to server/DC use-cases.

That's why ~15 years ago when I was in uni, you'd get audio stutter when playing music/movies of spinning rust on linux while torrenting file on the same HDD, and not on Windows/MacOS, due to different queuing algorithms used thet prioritised audio decoding tasks over everything else, which Linux kernel out of the box didn't, unless you tinkered and changed it.


> You have to remember the Win (and MacOS) kernel is tuned to consumer desktop user use cases, while Linux kernel is tuned to server/DC use-cases.

I don’t mind the kernel doing kernel things. The issue is system services and other software that are either unnecessary or badly coded. You can’t disable them because of “reasons” and they’re just wasting your time and your electricity.


> while Linux kernel is tuned to server/DC use-cases

That depends on the distro / flavor of kernel; the Linux kernel is pretty flexible and you can cut it however you want. If you use a distro like CachyOS for example, you'll find that they use a kernel tuned for desktop use-case, so you don't need to tinker with anything.


A tangent to this which annoys me is not specifically windows, but the way the ecosystem has evolved over the years, by guidance/enforcement or lack thereof from MS. Unless you're very careful about what applications you install and how you manage/monitor them, you can end up with a lot of background applications loaded each boot, each doing some combination of non-centralized updating itself or applications it manages, preloading, quick launch, etc.


> But the OS should be as lean as possible because the entire reason is to run other programs.

In my mind Classic Mac OS (minus its design issues) is the ideal to strive for here.

It was barely even an OS and more like a substrate for GUI applications to run on top of. Even “essentials” like networking and USB support were implemented by way of extensions which could be disabled at will. If you disabled all extensions you’d get something resembling a full color version of the original 1985 System 1.0 that took almost no resources. This was great for squeezing out every last drop for things like games and emulators.


It was that lightweight because it provided basically none of the functionality that is essential to a modern OS. Because it wasn't a modern OS.

The surface area of stuff that an OS has to do today is absolutely massive, and the dependency graphs are poorly understood even by the engineers who work on those systems. Innocuous pieces of functionality have a way of becoming load-bearing over time.

If you ran around disabling random bits of functionality in Windows because you wanted to reclaim some resources for your games, you'd probably wedge the OS, cause random crashes, and prevent your games from even launching. Like you might think "Well my game doesn't need Bluetooth, I only use a wired controller!" but I would not be surprised at all if yanking out the Bluetooth stack from the OS caused random crashes and hangs.


I’m not convinced that it’s impossible to build a modern OS in a way that’s properly modular and allows most functionality to be disabled entirely (as in never even loaded into memory).

Windows almost categorically can’t because it’s only ever been developed organically and is pathologically backwards compatible, which keeps it forever tied to past design decisions.

Linux could get a much closer but is hamstrung by monolithic kernel design which puts more functionality there.

You’d need a clean sheet design which positions most subsystems as discrete components.


"Linux" encompasses everything from microcontrollers to planet-scale supercomputers. You can, in fact, build a Linux that runs in as few resources as you like. No qualifiers.


Technically true, though that comes with the caveat that doing so requires considerable time and technical skill… we're talking compiling your own kernel and assembling your userland and desktop.

The nice thing about classic Mac OS is that its modularity was more accessible. All one had to be capable of to pare down or customize their install was move files in or out of /System Folder/Extensions/ and /System Folder/Control Panels/. I'd like to see a Linux desktop distribution that works that way.


> The surface area of stuff that an OS has to do today is absolutely massive, and the dependency graphs are poorly understood even by the engineers who work on those systems. Innocuous pieces of functionality have a way of becoming load-bearing over time

It’s not that huge. I use OpenBSD and the code is surprisingly approachable and readable. And even with no support for runtime modules, it’s pretty easy to customize and strip out whole features. Current complexity in something like linux is stretching the subsystems to support a huge array of use cases.


> The surface area of stuff that an OS has to do today is absolutely massive

Why though? The OS should be the layer between hardware and applications/the user. Provide a GUI SDK+toolkit and a firewall. The OS should be responsible for a dozen different cloud sync bs things that I play whack-a-mole to disable anyway.


Please educate yourself on how RAM is used https://www.linuxatemyram.com/


Or one can simply optimize the memory?


https://www.linuxatemyram.com/

Please educate yourself on how this is exactly how you optimise RAM usage


Over-allocating something you never use just to store it on disk to improve performance is like using the MacroSlop strategy of preloading Excel, lol. I’ve probably written more kernels, fuzzers, and low-level drivers than anyone on Hacker News, so please don’t tell me this strategy is helping these days. This just give excuse to developer to not optimize their app because it just works.


You clearly didn't bother to read the website I linked... Please educate yourself.


Until you open something else


The whole point is to cache frequently used things in RAM so when you open this other thing it loads faster


These days, swapping to disk means your SSD wears out and dies faster. That's very much an issue.




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: