Tuesday, 29 April 2014

Your machine slowly runs out of disk space after using Assembly Binding Log Viewer

I came into the office this morning to find my laptop complaining that disk space on drive C: was critically low - which was odd as my 240GB SSD should be less than half full.

After running SpaceSniffer it was taking ages in C:\Windows\system32, further digging through the graph pointed me to C:\windows\system32\config\systemprofile\appdata\local\content.ie5 which had around 300,000 files in it.  All of them were .htm files, so I (tentatively) opened a file up in Vim (so it wouldn't run any scripts, etc).  It was then I realised what they were - all of them - were "Assembly Binder Log Entry" files.

I then remembered several weeks ago trying to debug a .NET assembly binding issue, and I'd turned on "Log all binds to disk" in Fuslogvw.exe, fixed my problem but didn't really "click" that it needed turning off afterwards.  I naively assumed it would only be logging for the duration I had fuslogvw open.  Wrong!

Clearing out the Temp htm files from the above location (by running explorer.exe as an administrator and granting myself permissions) only freed up around 500MB however, I was still missing around 100GB(!).  

Running spacesniffer again gave me a new location to investigate: C:\windows\syswow64\config\systemprofile\appdata\local\content.ie5 - which makes sense as it's a 64 bit machine running mainly 32 bit binaries.  However, no matter how many times I tried, I couldn't grant myself access, there were simply too many files and it kept timing out.

In the end I followed the process listed here to use psexec to open a command prompt as the relevant user, and set off a del *.htm command which took a good 6 hours to complete, but at least I've got my disk space back, and I won't be making that mistake again in a hurry.