is TRIM automatic in Lion?

Discussion in 'Mac OS X Lion (10.7)' started by whitedragon101, Jun 12, 2012.

  1. whitedragon101 macrumors 65816

    Sep 11, 2008
    I have read various articles on what TRIM does at low levels but how does it actually work in practice on Lion?

    Does trim :

    a) Run on a user command? if so how often should you run it and how long does it take?

    b) Run automatically? If so does TRIM run in tiny bursts constantly informing the SSD of which blocks to erase or is it done periodically,if so how often and how long does this take?
  2. dcorban macrumors 6502a


    Oct 29, 2007
    TRIM is a low-level data command sent to the SSD by the OS. In layman terms, when you delete a file, the OS does the usual file delete stuff along with sending a special command (TRIM) to the SSD which informs the SSD which locations on the drive are to be erased, and made available for future use. TRIM is nothing that a user would run or even needs to be aware of.

    The reason this matters is that flash memory has to be handled a little differently than hard drives. On a hard drive, when you delete a file, it isn't actually deleted. Instead, a pointer to the file is deleted, but the actual data remains. When the hard drive wants to write to that part of the drive again, it just overwrites whatever was there without care.

    Flash memory must be erased before written. If the system just deletes the pointer to the file and leaves the data, when the SSD wants to write to that part of the memory again, it has to delay while it erases before writing the new data. TRIM allows the SSD to erase these areas during "downtime", or in batches, or whenever the firmware on the SSD decides it is needed.
  3. whitedragon101 thread starter macrumors 65816

    Sep 11, 2008
    Thanks :)

    It was the when and how TRIM runs (as you describe above) that I was unsure of. Every guide I read always talks in detail about how trim works in terms of block level/page level reads and writes but not WHEN TRIM runs. Anandtech always show their torture tests of SSD's by throwing lots of data at them and then showing the performance. Then they show the performance after a TRIM pass to see if it recovered. I guess they disable TRIM to run the test and manually run a pass.
  4. JRoDDz macrumors 68000


    Jul 2, 2009
    TRIM is automatic on Apple SSD's. On aftermarket SSD's you have to enable it. I use this: "Trim Enabler"

Share This Page