upvote
The BackRAMs
reply
A new take on the OOM killer: if a long-running daemon hasn't touched some heap pages for a very long time, perhaps the OS could assume it is leaked and unmap the pages. If the daemon tries to access that memory, let it crash.
reply
This sounds like a bad idea. No one has logged in via SSH for a while so the daemon hasn't touched any pages (or only pre-auth relevant pages) then when you log in it gets killed. Or if someone sends a rarely used request to an HTTP server then it crashes accessing some data unique to that request.

Sure, they will get restarted, but not great.

reply
It's a good example of perverse outcomes. Rather than simply following the contract and functioning correctly, we would be:

going through extra effort to accommodate/enable buggy, poorly behaving programs, and meanwhile—

punishing those (and the programmers of those) that are well-behaved and functioning exactly as intended but that now have to contend with evading some heuristic of badness.

reply
Or swap it to a less expensive medium, such as the SSD.
reply
I'd rather not have it waste write cycles

... but reading say libraries directly and only putting in RAM the parts often used, now we're talking

reply
That’s actually a very old idea, called paging or swapping. And it totally works
reply
deleted
reply
It's like having a room that shrinks everything to 1/5th of its size but you never come back to get anything. It will work until gets full.
reply
If the user was feeling stochastic, the OS could theoretically just drop pages that haven't been accessed in, say, 2 days, and send the process a segfault if it tries to access them.

Thus solving memory leaks forever...

reply
I believe one can create a kernel module called leaky_ram to make this possible. No?
reply
No need for a kernel module. Create a FUSE filesystem in user space on which to create a swap file. Once any written block is more than 2 days old just discard it. When they are accessed give EIO. This IIRC translates to a SIGBUS signal in the process.
reply
Wait until people find out about swapping.
reply
Oh we found out about it. In the old days, a machine with a load of 57380 (probably not the highest number I have seen) means the machine has run out of memory and started swapping heavily.

Fun days.

Now, we find out when the SSD wears out, in the worst case.

reply
How long does a wear leveling SSD take to fail if it is set to constantly write at it's fastest possible bandwidth?
reply
Paging to disk has also become vastly more transparent, and less of a last resort, with M.2 SSDs. No more things slowing down 10x and endless HD noise when out of RAM.
reply
Why the downvotes? I also was thinking that's a perfect candidate for swapping to disk.
reply
You can also combine both. Linux has zswap.
reply