DevPrep

All topics › Memory management

What is jetsam? How does the system decide which app to kill?

Senior PRO

What it is

Jetsam is the XNU kernel subsystem that forcibly terminates processes when memory runs low (the analogue of Linux's OOM killer, but with stricter policies because iOS has no swap). It fires in two cases:

The rest of this answer, with code and interview follow-ups, is in the DevPrep app.

Read the full answer in DevPrep

Practice this before your interview

DevPrep turns these answers into one-minute challenges: what does this code print, find the bug, mock interviews. One challenge a day.

Get DevPrep on the App Store