Garbage collection
A garbage collector is a separate module that’s usually incorporated in the runtime environments of interpretable languages. For example, C# and Java both have garbage collectors, which makes programmers’ lives a lot easier. The garbage collector tracks all the object allocations in the code and deallocates them once they are not in use anymore. It’s called a garbage collector because it deletes the memory resource after it’s been used: it collects the garbage left by programmers.
It’s said that C++ programmers don’t leave garbage after them; that’s why the language doesn’t have support for a garbage collector. Though programmers tend to defend the language by stating that it doesn’t have a garbage collector because it’s a fast language, the truth is that it can survive without one.
Languages such as C# compile the program into an intermediate byte-code representation, which is then interpreted...