What is the garbage collector:-
- The garbage collector is a mechanism which identifies garbage on the managed heap and makes its memory available for reuse.
- This eliminates the need for the programmer to manually delete objects which are no longer required for program execution.
- This reuse of memory helps reduce the amount of total memory that a program needs to run.
- In technical terms, we say that it keeps the program's “working set” small.