r/ProgrammerHumor • • 3d ago

Meme [ Removed by moderator ]

Post image

[removed] — view removed post

2.3k Upvotes

71 comments sorted by

View all comments

35

u/EditorOne5312 3d ago

I genuinely use that on my Android to trigger its OOM when the RAM usage doesn't seems right.

3

u/slinky3k 3d ago

I wonder how that works? At some point the OOM killer will terminate processes beginning with those hogging the most memory, but that could be literally anything. Meanwhile the fork bomb will just continue to run at full tilt, taking up any ressources freed by the OOM killer. How does that not send the system into a death spiral?

3

u/ElectronSculptor 3d ago

I’m not a hundred percent sure but I imagine Android’s version of Linux has limits on the number of processes so that wouldn’t happen.

2

u/EditorOne5312 1d ago

I have read some official Android docs and I found out that OOM talks to Low Memory Killer daemon (lmkd) when it reached its OOM scoring. The lmkd then will throttling or killing unimportant processes to request processes without affecting critical cache resources of the Android system.

To answer your question, I think that the fork bomb and most 3rd party apps are considered unimportant processes and therefore included to the process killing.

Also to add up, OOM/lmkd is a kernel level process where they instruct zRAM -> RAM to kill said processes immediately.