21
submitted 2 years ago by Sunshine@lemmy.ca to c/linux@programming.dev
you are viewing a single comment's thread
view the rest of the comments
[-] FizzyOrange@programming.dev 3 points 2 years ago

Don't hard-reboot when memory runs out.

[-] possiblylinux127@lemmy.zip 1 points 2 years ago

The process that takes up the memory is killed

[-] FizzyOrange@programming.dev 1 points 2 years ago

Not in my experience. Mostly it just hard-reboots. Occasionally a random process that is using lots of memory is killed (not necessarily the one you want). That only works about 5% of the time though.

[-] secret300@lemmy.sdf.org 1 points 2 years ago

systemd-oomd usually kills the process before that happens tho. My system will hang for a bit but then it figures it out.

[-] FizzyOrange@programming.dev 0 points 2 years ago

Ah maybe. I'm still on RHEL8. Even so, "it hangs a bit and kills a random process" is still shit! What it should do is suspend processes, and show you a GUI saying "you're running low on memory, here are your running programs and how much they are using" and allow you to choose which processes to kill, or whatever.

That would be far too user friendly for Linux though. I don't think the kernel/Wayland Devs could really comprehend that tbh. They'll say something along the lines of "users shouldn't be doing that".

[-] bleistift2@sopuli.xyz 1 points 2 years ago

show you a GUI saying “you’re running low on memory, here are your running programs and how much they are using”

Good luck with this approach on a server.

If by ‘suspend’ you mean that the process will just halt, then: Which processes? All of them? Good luck displaying a message then. The last one that made a memory request? That might not be the true offender. The highest-consuming process? Same logic applies.

If by ‘suspend’ you mean moving the memory to disk, then a single misbehaving process, may end up eating all of memory and all remaining disk space.

[-] FizzyOrange@programming.dev 0 points 2 years ago* (last edited 2 years ago)

Good luck with this approach on a server.

Indeed, obviously I'm talking about desktops here.

If by ‘suspend’ you mean that the process will just halt, then: Which processes? All of them? Good luck displaying a message then.

You could use some kind of heuristic to suspend ones using the most memory/CPU. Or just suspend them all. Obviously you would exclude the processes needed to display the message.

If by ‘suspend’ you mean moving the memory to disk

No I meant just pausing their execution. I'm pretty sure ctrl-alt-del does something like this on Windows.

this post was submitted on 25 Dec 2024
21 points (76.9% liked)

Linux

15451 readers
308 users here now

A community for everything relating to the GNU/Linux operating system (except the memes!)

Also, check out:

Original icon base courtesy of lewing@isc.tamu.edu and The GIMP

founded 3 years ago
MODERATORS