SSD Garbage Collection and TRIM Function

Discussion in 'backup, imaging & disk mgmt' started by TheRollbackFrog, Sep 20, 2017.

  1. TheRollbackFrog

    TheRollbackFrog Registered Member

    Joined:
    Mar 1, 2011
    Posts:
    4,465
    Location:
    The Pond - USA
    A first for me...

    In a test laptop (an older but solid DELL E6500 Core2Duo at 2.9ghz) containing an older (but no too old) OCZ Agility 3 series SSD, I do tons of OS, application, HDD/SSD and image restoration testing. It serves me well.

    Since a lot of my testing includes CLEAN INSTALLs of various Windows versions as well as image restorations done by apps which do not TRIM the SSD upon restore (Macrium REFLECT is the only one I know that can do that), the SSD's Garbage Collection would be the only real source of proper TRIMming/CleanUp within the SSD... I typically do not use OPTIMIZE in the OSes I test with during the testing phase.

    While tracking down a Windows 10 update failure issue due to lack of something that should have been on the System during the update, the tracking process threw out a DISK FULL message during the process even though Windows and its Disk Mgmt stated there was about 70gB free space on the 120gB SSD (no, I DO NOT USE Rollback RX which has a similar problem). This was strange so I ran the tracking procedure once again and received the same hard DISK FULL message from the OS... this happened over and over again

    Thinking about the situation a bit as to how this System has been used mostly, I wondered if the SSD, internally, was carrying around tons of DATA from previous work that had never been TRIMmed properly by the OS or by the internal Garbage Collection process.

    Since I was running under Windows 10 at the time, I decided to run a manual OPTIMIZE process on the SSD's only partition which ran to completion successfully. Following that I re-ran the problem tracking process (the one with the hard failure) and it now ran to completion without issue.

    Apparently the SSD had been carrying around appx. 70gB of old DATA and that the internal read/modify/write process (used to make storage available when all their CELLs have bee used) had all but exhausted available space.

    The whole thing was an interesting observation in what can happen to an SSD over time when not TRIMmed properly, or whose Garbage Collection may not be as sophisticated as the newer SSDs may have. Has anything like this happened to any of our Forum users that currently use SSDs (most by now I would assume)?
     
  2. Fad

    Fad Registered Member

    Joined:
    Feb 25, 2009
    Posts:
    441
    Location:
    England
    I`ve never had a disk full problem but I do have an older version of "Solid State Doctor" with which I use to occasionally manually Trim all the drives (one of which is old: OCZ-Vertex)

    I simply don`t trust/believe that Trim is working because I can`t see it ;)

    Is there any way of determining which blocks (cells ?) need Trimming ?
    I have always wondered but never found anything suitable.
     
  3. TheRollbackFrog

    TheRollbackFrog Registered Member

    Joined:
    Mar 1, 2011
    Posts:
    4,465
    Location:
    The Pond - USA
    That information is not available directly from the SSD... only the Garbage Collecting software/controller knows that.

    I have checked all my SSDs and if TRIM is active and Windows does the right thing (TRIM the SSD following the deletion of file content), the SSD data areas where that DATA resided indeed returns to its defined state (could be all ZEROs, all ONEs, all <value determined by the controller> or non-deterministic <but different than the original real DATA there>). If TRIM is active, it all seems to work just fine. It's when TRIM is not active, what is the Garbage Collection algorithm really doing and under what conditions?
     
  4. Arvy

    Arvy Registered Member

    Joined:
    Dec 31, 2011
    Posts:
    611
    Location:
    Canada
    Interesting question, Froggie. I've never encounter the situation exactly as you describe it. However, I'm unable to locate a scheduled task in my Windows Task Scheduler listings that corresponds to the default "Optimize Drives" setting for weekly trim operations. There is a scheduler "Defrag" operation ("%windir%\system32\defrag.exe -c -h -o -$") run with highest privileges, but its triggers aren't specified within the WTS task setup. One wonders if there may possibly be some "disconnect" between the optimizer utility function's settings and the task scheduler. There is no autostart service for it that would make specific task scheduling unnecessary AFAIK.
     
  5. TheRollbackFrog

    TheRollbackFrog Registered Member

    Joined:
    Mar 1, 2011
    Posts:
    4,465
    Location:
    The Pond - USA
    I believe Windows new defrag task has been modified to "optimize" SSDs (detected by Windows) and defrag HDDs accordingly. The Windows "optimization" process on SSDs is nothing more that pre-allocating all but a few 10s of megabytes of free space left on the device, then deleting the pre-allocated space causing Windows to issue TRIM commands for all that space just previous pre-allocated. This is what the SSDtool application does for me on Windows 7 which includes no optimization features but does support TRIM for detected SSDs.
     
  6. Arvy

    Arvy Registered Member

    Joined:
    Dec 31, 2011
    Posts:
    611
    Location:
    Canada
    In that case, would it not then depend entirely on the proper scheduling, triggering and operation of that singular Defrag task entry in the Windows Task Scheduler that is set via the optimizer's user interface?
     
  7. J_L

    J_L Registered Member

    Joined:
    Nov 6, 2009
    Posts:
    8,738
    When I had my Macbook, I was worrying about TRIM support for third-party SSDs. I applied the Terminal command to enable it, and everything seemed OK at first.

    But then weird corruption (like Safari) occurred if I remember correctly. Fixed that, and soon after it was out of my hands. Maybe the OS installation was just old, but not my problem anymore.
     
  8. TheRollbackFrog

    TheRollbackFrog Registered Member

    Joined:
    Mar 1, 2011
    Posts:
    4,465
    Location:
    The Pond - USA
    Apparently so. The automatic TRIM-after-Delete function is active at all times and in Windows 10 it appears to be active on any SSD-based volume (no so noticed under Windows 7 <need to re-check to be sure>). Under these conditions, Optimization appears to be more of a house cleaning function than anything else... unless you use that SSD like I did (very little deleting, mostly re-writing).
     
  1. This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
    By continuing to use this site, you are consenting to our use of cookies.