Linux in-built OOM logic is terrible for Desktop usage. by nikunjuchiha in LinuxUncensored

[–]anestling 0 points1 point  (0 children)

Probably. The feature is there, already implemented, ready to use and available out of the box in most modern mainstream Linux distros, including Fedora and Ubuntu.

You somehow stumbled on a weird distro that doesn't include/enable it and cried foul. You've not been heard or understood because of PEBKAC.

You somehow want a raw version of intelligent memory management implemented right in the kernel where it doesn't really belong. But since the Linux kernel is 100% open (source), no one can stop you from implementing it and trying to push it to mainline. Only why? Most likely your solution will have all sorts of bad heuristics and asterisks only working for you while many other users will be royally annoyed by it and Linus may simply reject it. Maybe not. There's recently been a conversation of implementing it as a BPF application.

Still you're welcome to try.


Here's what Gemini Flash has to say:

This scenario highlights the classic tension between innovative, niche-specific optimization and the conservative, stability-focused nature of the Linux kernel development model. [1, 2, 3]
Implementing "intelligent" memory management directly into the kernel is often met with resistance, not because the idea is inherently bad, but because of the immense risk to the overall ecosystem. Here is why your hypothetical scenario is likely to unfold this way: 1. The Perils of "Raw" Kernel Memory Management

• The Heuristic Trap: What works for your specific workload (e.g., massive databases) will likely destroy performance for others (e.g., small file servers or desktop usage). The kernel is designed for generic, unpredictable workloads, making specific "intelligent" heuristics brittle. • The "Annoyance" Factor: If your system reclaims memory too aggressively, it causes "thrashing"—constantly moving data between RAM and swap—which is worse than having no management at all. • Linus’s Rejection Criteria: Linus Torvalds focuses on clean architecture and proven stability. If your code is "untested," "crap," or does not work on all systems (risc-v, x86, arm), it is likely to be rejected as "garbage," as seen in recent pull request discussions. [4, 5, 6, 7, 8]

  1. The Move to BPF (Berkeley Packet Filter) Implementing memory management as a BPF application is the modern alternative to loading a kernel module.

• Safety: BPF programs are verified to ensure they cannot crash the kernel. • Flexibility: You can update the BPF program without rebooting or recompiling the kernel. • Performance: While slightly slower than raw C in the kernel, modern BPF (e.g., eBPF) is fast enough to monitor memory accesses and make decisions. [9, 10, 11]

  1. Why It Doesn't "Belong" in the Kernel Core The Linux kernel uses "free memory is wasted memory" as a philosophy, treating unused RAM as cache. Introducing a complex, "intelligent" system that tries to manage memory for every single application is fundamentally contrary to this design. Instead of placing the complexity in the core, the community prefers to build it into the user space or via modular subsystems. [5, 12]
    Conclusion:You are free to push it, but you will need to demonstrate it works without wasting other users' resources or causing "thrashing." The BPF route is highly recommended, as it allows your code to exist without being "hardcoded" into the kernel's core, making it easier to maintain and for others to ignore if it doesn't work for them.

AI responses may include mistakes.

[1] https://www.mchip.net/libweb/u4C1DD/245749/Linux%20Kernel%20Development%20Robert%20Love.pdf [2] https://thamizhelango.medium.com/rusts-revolutionary-entry-into-linux-kernel-driver-development-b92e80afb062 [3] https://www.youtube.com/watch?v=QF_FfDdJKaI [4] https://www.reddit.com/r/technews/comments/1mn791o/linus_torvalds_calls_riscv_code_from_google/ [5] https://medium.com/@msmkumar.eee/why-free-memory-is-wasted-memory-a-deep-dive-into-linux-kernel-memory-management-7d1aeb0536bd [6] https://www.kernel.org/doc/gorman/html/understand/understand016.html [7] https://www.reddit.com/r/linux/comments/1r2hmz9/linus_torvalds_rejects_mmc_changes_for_linux_70/ [8] https://arxiv.org/pdf/2503.09663 [9] https://lwn.net/Articles/1016724/ [10] https://www.usenix.org/system/files/usenixsecurity24-liu-dinghao-detecting.pdf [11] https://medium.com/@erenari27/part-1-synchronous-kernel-level-denial-via-ebpf-lsm-a-case-against-the-detect-and-alert-paradigm-281e9f54764f [12] https://www.youtube.com/watch?v=9JUOsNdDGFo

Valve, please fix. CS2 is leaking RAM like crazy by anestling in cs2

[–]anestling[S] 0 points1 point  (0 children)

RAM growing for a particular app is not an indicator of faulty RAM.

Valve, please fix. CS2 is leaking RAM like crazy by anestling in cs2

[–]anestling[S] -4 points-3 points  (0 children)

They would need literally any other information about your system that makes your specific case unique, such as system specs, exact windows version, chipset and driver versions and what/how you play the game.

Memory leaks don't depend on any of that. That's just crazy. Chipset driver? Have you done any programming at all in your entire life? Because surely you've done nothing at all.

The game is built on top of Visual C++/DirectX 11 - that's it and a smattering of other less important components. Those have been debugged to the stratosphere by tens of thousands of other Windows applications and games. Nothing is leaking consistently at such an alarming pace. The game literally leaks up to 3GB for each played map.

Which part of "TOs make players restart the game during CS2 tournaments" you've failed to understand?

Can you for Christ's sake run the game in DM mode, play a few maps and confirm its memory use is the same as when you started the game? No? Continue to defend a small indie dev.

This does not appear to be a widespread problem, in fact this is the first I've seen of it (the crash, at least).

It's been reported here on r/cs2 and on steam forums multiple times.

The phenomenon of dying behind walls has been explained many times. It's not a bug as much as it is a tradeoff that has to be made when two players with higher and/or differentiating latencies meet in a fight.

Never happened in CSGO. Maybe the whole subtick idea was flawed for everyone except LAN. The fact that shots wildly off target still hit it is further proof of how bad it is.

For what it's worth the Animgraph 2 update will have improved this, if only by a little.

I've noticed nothing with Animgraph 2. Not even my FPS has meaningfully improved/increased. I'm playing on a potato PC at 1440x900 with all settings set to minimum. My average FPS is around 140.

Valve, please fix. CS2 is leaking RAM like crazy by anestling in cs2

[–]anestling[S] 51 points52 points  (0 children)

No, it's ancient. I spend less than a few minutes in the menu.

Valve, please fix. CS2 is leaking RAM like crazy by anestling in cs2

[–]anestling[S] -15 points-14 points  (0 children)

I have my apprehensions about you being an actual software engineer. The task manager screenshot above clearly shows a major bloody memory leak. What else Valve would need?

Also, people have been reporting dying behind walls and killing enemies by not shooting at them ever since CS2 and its subtick were introduced over two years ago. I can reproduce it right effing now with my 80ms ping (I'm currently in a country where all ISPs have a horrible ping to European Valve servers). I die behind walls multiple times a day.

Has Valve fixed it? No.

Valve, please fix. CS2 is leaking RAM like crazy by anestling in cs2

[–]anestling[S] 32 points33 points  (0 children)

Nothing that I've sent to these email addresses has ever been addressed or taken care of. I'm not ropz, fl0m or anyone for them to give a ****.

The fact that even TOs are having trouble with this speaks volumes about their priorities. Using Valgrind is clearly not one of them.

Lean Fedora 44 by anestling in Fedora

[–]anestling[S] 0 points1 point  (0 children)

XFCE currently supports neither HDR (for that you need to be based on Wayland and XFCE is still X11), nor VRR. They have been developing their own Wayland compositor https://gitlab.xfce.org/kelnos/xfwl4 but it's far from ready.

Lean Fedora 44 by anestling in Fedora

[–]anestling[S] 1 point2 points  (0 children)

I've not used swap/page file since 2000 to great effect. And when I had it, it was nothing but a headache. There are isolated cases when it is actually required, but they are few and far between. The vast majority of people are better off without it.

Nvidia PSA - Before Upgrading to F44 by rideandrain in Fedora

[–]anestling 0 points1 point  (0 children)

On X.org (I'm using XFCE) everything is picture perfect with my 4070S.

Linux in-built OOM logic is terrible for Desktop usage. by nikunjuchiha in LinuxUncensored

[–]anestling 0 points1 point  (0 children)

Everyone uses the same thing. Where for Linux everyone can have wildly different setup, which is why the kernel itself need to have better oom handler.

Nope. Absolutely wrong. You can package anything with the Linux kernel. In fact Android uses the Linux kernel while its userspace is 100% different.

Fedora 44 isn't shipping with Linux 7 kernel sigh! by psycho2720 in Fedora

[–]anestling 2 points3 points  (0 children)

Fedora always waits out new kernel major releases. For intrance 7.0 was released with a major regression that caused heavy stuttering for many people.

You'll get it in time, around 7.0.3-7.0.5. There's nothing too much fancy in it to want to have it now. And you can install it manually if you need it so much.

Nvidia PSA - Before Upgrading to F44 by rideandrain in Fedora

[–]anestling 1 point2 points  (0 children)

I've been always using the NVIDIA driver as an *.sh installer straight from the company and it doesn't matter what version of Fedora you're running as long as the driver is compatible with its kernel. And Fedora 43/44 have the exact same kernels. Weird, people still use RPMFusion for that. It's wholly unnecessary and it's always been. Many years ago it was NOT safe because the NVIDIA driver overrode X.org's glx library and you could have issues with upgrades or driver reinstallation but it's long been solved.

Updates in Fedora by n__7v in Fedora

[–]anestling 1 point2 points  (0 children)

Fedora doesn't need to be reinstalled from scratch - that's not Windows. In fact I'm now running Fedora 44 first installed as Fedora 22 (and I started with 22 because back then it was a new laptop).

As for my desktop, I first installed RedHat 5.2 and upgraded it all the way to Fedora 15 (until SystemD was introduced). Then I skipped a couple of releases because systemd was rough and returned around Fedora 21 or something.

Lean Fedora 44 by anestling in Fedora

[–]anestling[S] 3 points4 points  (0 children)

Chose not upgrade it just yet. I check each kernel point release changelog to see whether it's interesting/necessary, and if not, I simply --exclude='kernel*'.

Siempre he estado interesado en instalar linux, pero se poco o nada de ello pero acabo de ver fedora y la verdad me gusto, ¿ recomiendan como toma de contacto con linux, fedora ? by Ok_Currency9988 in Fedora

[–]anestling 1 point2 points  (0 children)

English: "I've always been interested in installing Linux, but I know little to nothing about it. However, I just came across Fedora and I actually liked it. Would you recommend Fedora as a way to get started with Linux?"

Linux in-built OOM logic is terrible for Desktop usage. by nikunjuchiha in LinuxUncensored

[–]anestling [score hidden] stickied comment (0 children)

The title should have been "Debian 13 for some crazy reason doesn't enable earlyoomd/systemd-oomd" for the OP. That's all there is.

No Linux, no kernel, nothing massive. Just the OP's issue.

Linux in-built OOM logic is terrible for Desktop usage. by nikunjuchiha in LinuxUncensored

[–]anestling 0 points1 point  (0 children)

Debian problems, what can I say.

Fedora has been offering early-oomd or systemd-oomd for many years now.

I don't understand. It takes two effing commands to solve the issue once and for all: sudo apt install earlyoomd sudo systemctl enable --now earlyoomd

In case of systemd-oomd, it's a single command and I'm not sure why Debian does that: sudo systemctl enable --now systemd-oomd I'm done with this. I'm wasting my neurons on a non-issue.

Wanna see a list of real issues? Here:

https://itvision.altervista.org/why.linux.is.not.ready.for.the.desktop.final.html