When is TRIM executed?

When does macOS send the ATA TRIM command to the SSD's controller?

  • After deleting a file? Like Windows 10 does.
  • After a fixed amount of time? Like Ubuntu and Fedora do, once a week.

I'm assuming macOS Monterey and an Apple SSD.


It is issued after deleting a file (technically it is a bit more complicated involving vnodes and ensuring that no other process has the same file opened).