Sure, they will get restarted, but not great.
So don’t change the OOM descision making, just the action taken.
I think the person below makes a good point though, that this encourages or permits buggy code.
If the oomkiller is running, it's too late to wait and see: some process or kernel thread needs memory that the kernel can't currently provide
Not how I expected the next big optimization push, but I'll take it.
... but reading say libraries directly and only putting in RAM the parts often used, now we're talking
Apparently though, tracking pages and access and stuff would be very slow.
I continued thinking about it on how to structure go or jvm apps that you split it in processes so they are more bound to when they are needed and you unload parts of your tool/programm by just handing over the results from one process to the other and kill it.
I have trouble thinking of a daemon this wouldn't break. It might break even a simple clipboard manager when you go back through the history.
Why not just change Linux's vm.overcommit_memory to not allow overcommitting, so that when a daemon/process does a malloc() an error is returned and it can be handled right away?