Hacker News new | ask | show | jobs
by kevincox 11 days ago
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.

2 comments

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.

You have described the current state of Android development if you want your app to stay alive and be useful without its GUI in the foreground. It is an insidious process that has essentially broken the OS more with each release, and broken apps that were mindful of battery usage but didn't pull the correct magical levers.
So true.

On my Lenovo tablet there is no working way to get it to allow any app to stay open.

I deliberately bought the version with the most ram, but that was dumb because it never uses any of it because it so aggressively kills apps.

It's unbelievably annoying. I've spent an inordinate amount of effort to try to work around it, but it still regularly kills apps that I want to stay open. Those apps do stay open and work properly on my phone, which has less ram than the tablet.

Fuck you, Lenovo.

Webapps.
Yeah this is the modern trend it seems. There is a potential problem. Add more stuff around it. To the point where you aren't trusted with your own computer.
"All means are fair except solving the problem"
I think what they are saying is if OOM was going to kill the process anyways, it can defer this a bit and only fault on read or write on the rarely used memory.

So don’t change the OOM descision making, just the action taken.

I think my sibling comment makes a good point though, that this encourages or permits buggy code.

OOM triggers when memory pressure is critical; it's not practical to further defer addressing it at that point.
Huh? Defer addressing? You are even more confused than the person I responded to. The memory would be reclaimed in this scenario, it is entirely “practical” in that sense, there is no contradiction.
Defer /addressing/fixing/solving/ the problem.

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

No one said we were deferring fixing the problem. Memory is reclaimed. We would only be delaying or avoiding the part where the process is killed.
What for? Since the OS can't guarantee whether the memory it yanked out of the process' address space was leaked or rarely used, as far as the OS is concerned, the program is now in an invalid state, so the best option is to kill it immediately. At least then the crash would correlated with when the program was already effectively dead.