Just a TEMPorary issue

Since a few days, my Visual Studio 2013 is behaving strangely: a few apparently random error here and there, but nothing really serious and not solvable by the usual save-the-day restart.

Of course I promised myself to eventually have a closer look at the issue and I was force to do so this morning when VS stopped to work properly.
I first noticed the left margin where line numbers and “+” sign for the code collapsing was missing, a strange error was shown at startup and finally, worse of all, the Reference Manager refused to work properly crashing the entire Environment trying to load the lists.

After a brief internet search i found a useful post on the usual StackOverflow with a link to this MSDN documentation.
It seemed a good idea to have a look at my temp folder located – for Windows NT-like operating systems – at

%userprofile%\AppData\Local\Temp

in fact I found a huge number of TMP files together with thousands of other files and hundred of folders

The need for a temporary storage is evident to any programmer and to any serious computer worker, but it appears the vast majority of applications treat this place as unlimited space with no rules and with the assumption someone else is going to periodically clear it.

I started by deleting files with command line in order to speed up the process, then I tried to clean up folders. Some of them were in use and so not removeable. So I had a look at the locking process using the excellent tool LockHunter: this way I had the chance to learn a little bit more about the misbehaving applications and to release temporary files by cycling close and open the interested application.

Lessons for today: for the developers, follow your parents’ advice to clean up your own mess, now including your own application’s mess!
When your application creates temporary files, try to clean them up, inform the user and document what the application is doing.
For the (power) users, the suggestion is to keep a closer look to this folder and clean it when the number of folders and file clearly became unreasonable.

Advertisements