Exceptionally large file size problem on Windows/VS2017

Started by
8 comments, last by FRex 5 years, 3 months ago

Hello Everyone,

I have a problem that I can't figure out. It's on Windows 10 and Visual studio 2017.

I have a project folder called E2D_S tha1389577067_projectsize.jpg.281b050492462b371f5c3c99ae787c76.jpgt has a ridiculous size of 5.01GB. All the *.h and *.cpp files plus a few images don't add up to this amount.

When I drill into the folder and compare that with the size of what's inside the E2D_S folder, the size becomes a more reasonable 216MB.

Does anyone have any clue what's going on here?

Thanks so much for the help,

Mike

201168580_Insideproject.jpg.4ade19c2290b0993b8f074292befd960.jpg

Advertisement

VS2017 spawns a hidden .vs directory that might contain cached data. The same is true if you have a code versioning system like SVN or Git installed and your directory is flagged as repo

I had something similar. In my case, the extra gigabytes belonged to .ipch files - precompiled headers used for IntelliSense. They were in a hidden folder. I'm pretty sure they don't need to be that large, and deleting them should cause Visual Studio to regenerate them the next time you open the project, they may end up being smaller.

Thanks for the response guys. That makes sense.

I never had anything similar happen on VS2012 but then again that version did not have IntelliSense (as far as I know).

Mike

The 2012 Version stored those into a file in user space. Vs2015 started to create those hidden .vs directories to place cached things in first

You should turn on the 'show hidden folders' (and turn off the 'hide known file extensions' one too).

There's literally no reason not to and it avoid many silly situations situations like this one.

If you ever (by accident) open a directory in VS using the context menu this hidden .vs folder will be made too, even if you instantly quit VS.

Git on Windows creates .git folder and marks them as hidden in explorer too.

There are also tools that can summarize contents of disk or folder by sizes, file types, etc. for you if you're ever confused what's taking up space on your disk or in some folder. I use WinDirStat because it's FOSS and I'm used to its looks but there are many newer ones that work the same but much faster by reading the NTFS master file table.

On 1/14/2019 at 9:28 AM, FRex said:

There are also tools that can summarize contents of disk or folder by sizes, file types, etc. for you if you're ever confused what's taking up space on your disk or in some folder. I use WinDirStat because it's FOSS and I'm used to its looks but there are many newer ones that work the same but much faster by reading the NTFS master file table.

File searchers are another useful tool class that can become similarly very fast by restricting itself to NTFS file systems and file metadata only (for example Everything, which I use, but there are a couple of others). They show all files, allow easy and very accurate search and deletion of unwanted temporary or disposable files of the kind that's being discussed in this thread, and are fast and lightweight enough to allow realtime monitoring (what's the last log file? has that file been actually updated? What's this intense disk activity? Find it out by sorting all files on the disk by modification date).

Omae Wa Mou Shindeiru

Thanks FRex.

As soon as I turned on the hidden folders through control panel I am able to see the .vs folder including it's massive size. I will look into some of the tools you suggested.

Mike

10 hours ago, LorenzoGatti said:

File searchers (....)

Yes. There are file searchers that can search by name thru literally all files (over 500k of them for me) on a disk or few/all disks (I have an OS 256 GB SDD and a 1TB HDD) in a couple of milliseconds like that (I never perceived a delay in one I use). I also use http://www.voidtools.com/support/everything/

I didn't list that one since a file searcher doesn't help with finding out what kind, size and amount of files are in the folder as conveniently as WinDirStat or similar does.

WinDirStat is old and also doesn't use NTFS MFT but it's fast enough for me (a minute or two at most) and I prefer it over some tool that has an ad or banner asking me to buy/donate. It's development seems dead but it's FOSS so if needed I could compile or extend it myself even (but it's written in C++ with MFC).

Reading raw disk is also very easy via WinAPI but you need admin rights and to seek/read by sector size and have right flags (and know NTFS structure from somewhere): https://support.microsoft.com/en-us/help/100027/info-direct-drive-access-under-win32

This C program prints sizes of all NTFS partitions taken from their NTFS headers: https://gist.github.com/FRex/5ee5d6efd4910ad90b24a84a429dfe9b

I've no idea if there is a special purpose API for NTFS MFT in WinAPI or COM. There might be. I googled but couldn't find it.

If you ever want to play with NTFS structure then make a 1 GB ram disk, format it as NTFS, copy some files onto it and saving that ramdisk to a file. It will let you open it easier in a hex editor or a normal non-admin ran program. I use Imdisk for my ram disk needs: http://www.ltr-data.se/opencode.html/#ImDisk

7zip also supports opening an NTFS image (and few other FS formats and many archive formats): https://www.7-zip.org/

NTFS MFT also keeps names of deleted files (I'm not sure how long) in MFT so if you ever delete your very_evil_plans.txt you're not in the clear just yet (even when it's gone from trash bin). :P

 

7 hours ago, too_many_stars said:

As soon as I turned on the hidden folders through control panel I am able to see the .vs folder including it's massive size. I will look into some of the tools you suggested. 

Yes. That and not hiding extensions are two very useful things to programmers and most people. It's silly they are off by default.

This topic is closed to new replies.

Advertisement