What is a Garbage collector?- It is a form of automatic memory management.
- It removes the unreferenced objects from heap memory.
Garbage collector has two main goals:
1. Unused memory should be freed. 2. No memory should be freed unless the program will not use it anymore.
- It can prove that unused memory will never be used again.
|