is TRIM automatic in Lion?

whitedragon101

macrumors 65816
Original poster
Sep 11, 2008
1,259
283
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?
 

dcorban

macrumors 6502a
Oct 29, 2007
913
28
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.
 

whitedragon101

macrumors 65816
Original poster
Sep 11, 2008
1,259
283
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.

TRIM allows the SSD to erase these areas during "downtime", or in batches, or whenever the firmware on the SSD decides it is needed.
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.
 

Similar threads

  • CharCat
1
Replies
1
Views
162
  • wisevot1900
8
Replies
8
Views
1K
  • lokilaufey
0
Replies
0
Views
381
Register on MacRumors! This sidebar will go away, and you'll see fewer ads.