I'm currently studying algorithms and advanced data structures; since I'm familiar with C and it does provide a great level of control above implementation and pointer usage I'm using it to test the understanding of the subject so far.
When testing structures that need dynamic things like lists and trees I asked myself: since C doesn't have a garbage collector, if I don't call the free()
function in order to deallocate all the variables I dynamically allocate, where does that memory go?
Other related questions incude (sorry for misusing some terms, I don't have much experience in low level abstraction):
Does the compiler use the actual hard drive resources (like a variable is in the x record of my drive) or it "instantiates" a portion of virtual memory to compile and run my programs?
Do I have lots of lists, trees and graphs in my hard drive, all of them involving counts from 0 to 100 or the strings "abcd" and "qwerty"?
Does the OS recognize said data as garbage or I'm stuck with this junk forever until I format the drive?
I'm really curious about it, I never went below the C level of abstraction.