Help my Windows Server 2012 (2016) deduplicated drive is gone crazy (not releasing space)

I make use of deduplication feature on Windows Server 2012, and Windows Server 2016 quite extensively. And, it does wonders. Its deduplication ranges from 10% (wsus content, backup server) to upwards of 55% ( File Share servers and SCCM Distribution Points with ISOs and .wim images, as well as packages and applications).

Recently, a case was brought to my attention where a  drive with wsusContent on freshly installed Windows 2016 server has started running out of space. Initial drive size was about 100GB, and after few
days  it had to be extended (wonders of virtualization) and another 50GB  added to it due to an insufficient space. Less than a week later case repeats again.  In previous SUS versions (2003/2008/2012) we were using about 250-300 GB of space. Now the drive size has been increased to 800GB, and it was still running out of space.

It was identified that the Data Deduplication feature was turned on, and wsusContent folder “Size” was showing up as 455 GB and “Size on disk” is only 190GB, that is well above 55% of deduplication.

It was clear that deduplication is not working as expected, and a cleanup job had to be run to free up some space.
Start the Powershell- with Windows Server 2016 most of the dedup cmdlets are available with x64 bit version of Powershell only.
Running a Deduplication  Optimization job did not help at all:

"Start-DedupJob  -Type Optimization -Volume e:"

as a secondary choice a Full Garbage collection was run; its primary purpose is to ” free up all deleted or unreferenced data” as per Microsoft’s docs. I didn’t expect much of a deleted or unreferenced data, since this was a freshly installed OS, and WSUS data was downloaded during last few weeks.

"Start-DedupJob -Type GarbageCollection -Full -Volume e:"

Check the job status few minutes later


After an hour or so later the Full Garbage collection has finally finished.  The results were astounding. We now had close to 300 GB of space freed up.

You could run the Garbage collection again a day or two later, and see if it frees up more space.