3

Whenever I delete a large set of files (multiple GB) I noticed that this doesn't free space as much as I would expect. My expectation is that if I delete a certain amount of data my free space will go up with the same amount.

However, if I delete 5GB of files, empty the trash and look at the free space on my hard disk, it hasn't gone up with 5GB. This happens both on Windows XP and on Windows 7.

So what happens with the space that the deleted files were taking in? Why is there no one-to-one relation between the amount of data deleted and the amount of free space reclaimed?

I found similar questions for Mac and Linux, but not for Windows. I use the Windows Explorer for determination of the file sizes and free space.

  • Are we talking about 2 or 3%? Or are we talking about gigabytes? – David Schwartz Nov 25 '13 at 1:12
  • I just threw out 10.5 GB of data. After emptying the bin I reclaimed 4.5 GB free space. This is not consistent though and varies a lot. – Saaru Lindestøkke Nov 25 '13 at 1:34
  • 2
    The data isn't hardlinked/symlinked in any form, is it? Other than this, only if you have a process gobbling any free space you have or you just have very little space and the paging file (virtual memory) is expanding to the free size you just left. – Doktoro Reichard Nov 25 '13 at 2:24
  • 1
    You need to specify EXACTLY how you determine both the size of the files you deleted, and the alleged free space. The pronouncements of Windows Explorer, for instance, are notoriously unreliable, as it frequently double counts linked files. Certain NTFS filesystem features will naturally result in fewer bytes being "freed" than were contained in a deleted file. For a reliable reckoning of filesystem freespace, use something that consults the NTFS Allocated Cluster $Bitmap metafile. – kreemoweet Nov 25 '13 at 4:34
  • The files are not symlinked. They are data files created by a simulation program. I use Windows Explorer to check sizes, so that might be the reason for the incorrect behaviour. Now I'm curious on why the Explorer does not show free space reliably, but that is content for a new question. – Saaru Lindestøkke Nov 25 '13 at 13:25
3

There are a couple of things to consider here.

  1. Files may be counted twice or more due to hardlinks/symlinks
  2. If "System Restore" is enabled Windows may retain a backup-copy in a hidden location.
  3. Files can be allocated "sparse" which means that unused blocks within the file are not really allocated on-disk. The size shows as the "total" size of the file, but when deleted only the used parts are freed, so there is less gain than expected.
  4. Files can be compressed, so the actual space they take (and which is freed) is substantially less than the reported size.
  5. The MFT (which is an area on disk where NTFS keeps its internal administration) can grow and/or get fragmented which, under some conditions, can mean it grows when you delete files. (Should not make a huge difference though.)
  6. If you delete a file which is still in-use by a program, it can be that the file appears to be deleted, but it will not be really freed until the program releases/closes the file.
  7. Last but not least: In some cases file-system corruption may cause an incorrect reporting of the free space. A "Chkdsk /f" or a "Check & Repair" via the disk-properties gui should sort that out.
  • Although a useful answer, it doesn't answer the question. – Nic Szerman Jul 17 '18 at 14:40

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.