Dismiss Notice
Join Physics Forums Today!
The friendliest, high quality science and math community on the planet! Everyone who loves science is here!

General computing questions

  1. Oct 1, 2009 #1
    I've been reading the thread on completely erasing hard drives as well as a bit on the File Allocation Table (i.e. FAT). Apparently formatting your computer does not completely erase your data from the disk. So I have some questions:

    1) Does the FAT contain a collection of "pointers" to files? Perhaps it's similar to a reference in Java where it simply tells you where something lives in memory?

    2) So formatting your hard drive just erases pointers from the FAT, and doesn't actually delete the file from memory? Isn't that the same as, or at least similar to, a memory leak?

  2. jcsd
  3. Oct 1, 2009 #2


    User Avatar
    Science Advisor
    Homework Helper

    Sort of - the FAT contains the file name and the start cluster number which is analogous to a memory location. The drive maps that cluster to a particular head/cylinder/sector to get the actual data

    It doesn't delete the data from the magnetic surface of the drive. It just deletes the entry in the FAT. When the OS comes to write more data it will use the next free cluster, which might overwrite previously deleted data. The strategies for cluster reuse get a bit more complex in more modern filesystems.

    A memory leak (in memory) occurs when you have marked some memory as 'in use' by allocating it but have lost the pointer that stored where that memory is an so you can't ask for it be deallocated/free'd when you don't need it - not really the same thing.
    The leak comes from the fact that you can't allocate that memory for anything else while it is in use.

    In fact when you free memory in and ask for some more you might get back memory that contains the previous data, exactly like reusing disk space - since freeing memory doesn't generally set the contents to 0.
Share this great discussion with others via Reddit, Google+, Twitter, or Facebook