Post #1736084
2022-11-22 16:02 UTC
@gabrielesvelto This is amazing! Follow-up question: the Bugzilla discussion says "On Linux we have a way to instruct the OOM killer to reap the content processes before the main process when the memory is tight. While we don't use this yet it's something that's feasible."
How do you do this exactly? I thought the kernel doesn't have hooks for this. Do you run your own oom detection process? Cgroups? Something else?
Replies (1)
-
@gabrielesvelto@fosstodon.org 2022-11-22 17:16
@itamarst on Linux we use the oom_score_adj values of each process to direct the OOM killer towards the ones we want reaped first, see this bug: https://bugzilla.mozilla.org/show_bug.cgi?id=1771712 Fun story: the original code to implement this was written for Firefox OS and I pulled it from the KaiOS branch which is a fork of Firefox OS but based on recent Firefox versions.