Skip navigation

Source code editing and SSD wear?

1279 Views 10 Replies Latest reply: Apr 26, 2011 8:43 AM by K T RSS
cesarpixel Level 1 Level 1 (10 points)
Currently Being Moderated
Apr 25, 2011 1:47 PM

Hi there!


I'm using a brand new late 2010 13'' Macbook Air for coding. I'm really amazed by this tiny (yet very capable) machine, and enjoying it a lot.


However, I see that TRIM is not yet enabled for this machine on the current 10.6.7 OSX. I'm a bit worried of SSD wear (yes, it's my first SSD machine ), mainly because when you edit code, you overwrite the files you're editing a lot of times per session. While the limit of 10000 writes may seem high for casual users, I feel it's a low number when editing code. I feel that TRIM could lower these worries, as I guess it would write data into blocks with the fewest writes, in order to have uniform write numbers across the SSD... (well, I'm just guessing, I never used SSDs before).


I was considering using a ramdisk for programming, in order to save the SSD lifetime, but maybe I'm exaggerating... I just don't know.


Is there some way I can force OSX to use a huge disk cache and only write it to disk at shutdown? (my Macbook Air has 4GB RAM, and I can afford using 1GB for disk cache, if it was possible to manually configure the cache behaviour).


Thank you in advance,



  • K T Level 7 Level 7 (23,215 points)
    Currently Being Moderated
    Apr 25, 2011 1:59 PM (in response to cesarpixel)

    I would worry more about filling it up before wearing it out. It will be time to replace it with something larger first, I think. Check your warranty - buy the extended (Apple Care) warranty if that sounds appealing for any reason.


    As for writes, OS X purposely writes non-contiguous.


    You can always connect an external drive and work projects there if you're worried.


    As well, jump the ram too.

  • etresoft Level 7 Level 7 (23,905 points)
  • K T Level 7 Level 7 (23,215 points)
    Currently Being Moderated
    Apr 25, 2011 5:22 PM (in response to cesarpixel)

    It's the same reason fragmentation went away as a major issue when OS 9 was left behind.


    adaptive hot file clustering


    Most files on a disk are rarely, if ever, accessed. Most frequently accessed (hot) files are small. To improve performance of these small, frequently access files, they are moved near the volume's metadata, into the metadata zone. This reduces seek times for most accesses. As files are moved into the metadata zone, they are also defragmented (allocated in a single extent), which further improves performance. This process is known as adaptive hot file clustering.

    #The relative importance of a frequently used (hot) file is called its temperature. Files with the hottest (largest) temperatures are the ones actually moved into the metadata zone. In Mac OS X version 10.3, a file's temperature is computed as the number of bytes read from the file during the recording period divided by the file's size in bytes. This is a measure of how often the file is read.

  • etresoft Level 7 Level 7 (23,905 points)
    Currently Being Moderated
    Apr 26, 2011 5:08 AM (in response to cesarpixel)

    It is my understanding that every write takes place in unallocated space and, if successful, the previous blocks are deallocated. I'm not a hardware guy so I can't point to the paragraph in the spec where it says that in so many words. Still, the filesystem makes no further effort to disperse data throughout the drive. You are still likely to write in the same general area of the disk. OWC sells aftermarket SSDs that have logic that is supposed to disperse data across the entire drive.


    If you buy a MacBook Air, that is just the price you pay.

  • K T Level 7 Level 7 (23,215 points)
    Currently Being Moderated
    Apr 26, 2011 6:42 AM (in response to cesarpixel)

    cesarpixel wrote:


    What happens everytime you re-save that file? Is it overwritten in the same cells in the SSD? If affirmative, then it's a problem, because you could reach the 10000 writes limit in weeks for some cells, while other cells in the SSD would still be with zero writes.


    Entire files aren't rewritten each time you save. The change is written to a new location. When the original write expires it is freed up - simply marked as available, not zero'd out...the data is still there.


    If the original file represents 10 characters in a string (+ name, date and location on disk), and you change 2 of them, the data representing the original 2 on disk is marked as free and the data representing the new 2 is written somewhere else. 1 write of one size (10 chars + created date to the index) and 1 write of another (2 chars + modified date).


    The Air is the last computer Apple sells I would recommend for dev work (which tends to consume, rather than demand, resources), but not for the reason you're proposing.


    The article you quote doesn't seem to change anything....write cycles are limited, sure.


    Again, it has a warranty...if Apple Care is still an option, buy it if you're worried. You own it now...seems like the horse has left the cubicle

  • K T Level 7 Level 7 (23,215 points)
    Currently Being Moderated
    Apr 26, 2011 8:43 AM (in response to cesarpixel)

    >But, yes, the mindset of a big part of the Mac community who think the Air is a toy has to change.


    It's just a tool, albeit niche, like anything else - different strokes for different folks. I don't really expect it to survive given the rise of the iPad, tho.


    As I said, dev work consumes resources. I don't think it represents anything unique beyond any other type of usage. Discussion here in the past recommend anything but the air for dev work BTW.


    For my money, a refurb'd mac mini server from the Apple Store, coupled with external FW drives and large monitors, is still the best investment, bargain wise.


More Like This

  • Retrieving data ...

Bookmarked By (0)


  • This solved my question - 10 points
  • This helped me - 5 points
This site contains user submitted content, comments and opinions and is for informational purposes only. Apple disclaims any and all liability for the acts, omissions and conduct of any third parties in connection with or related to your use of the site. All postings and use of the content on this site are subject to the Apple Support Communities Terms of Use.