tech support request 

How do I tell Linux: if this program is eating all memory except for 10MB, just kill it instead of swapping everything into those tiny leftovers?


tech support request 

Because this program is very well behaved and doesn't crash if its allocations fail, so it will just stay there having claimed almost every byte.

tech support request 

Looks like my afternoon project is going to be learning cgroups!

tech support request 

status: running "systemd-run --user --slice=limit-mem.slice -t -d" instead seems to work, now to hack Lean's rustup clone to do the invocation via systemd

fixed? re:tech support request 

lean --help runs in a new unit!

fixed! re:tech support request 

And the process "successfully" hung at 50% memory consuption instead of 99% 🎉 🐙

un-fixed :( re:tech support request 

dang, the LSP edition does not appreciate running in a cgroup, huh?

re-fixed! re:tech support request 

okay, `systemd-run --user --slice=lean.slice -tPdqG --wait lean --server $file` seems to work!

@Vierkantor Oh wow. These good intentions suddenly feel very cruel.

@Vierkantor It would be nice if there were some sort of back-pressure in the memory allocation mechanism, instead of just having the two possible results be "sure mate, here's your memory" and "there's absolutely no way I can give you any more memory, I'm dying".

@Vierkantor I forgot there's also the Linux way: "Sure mate, here's your memory, oh, you want to actually use it? Damn, I was hoping you wouldn't. Here I go killing again."

@samgai What's that way you're speaking of? The only Linux way I know is: "Sure mate, here's your memory! You wan...t ... to ... u..s..e... iiiiiiiiit...... [can someone power cycle me already?]"


Sign in to participate in the conversation

Mastodon is a server for a federated social network: everyone can run a server if they want to, including me. So this is a Mastodon server for me (Vierkantor) and my friends.