https://en.wikipedia.org/wiki/Garbage_collection_(computer_science)
Garbage collection (GC) refers to the removing/deallocating/freeing data from memory that no longer has a reference in memory.
Many languages have a garbage collector built into the runtime environment that does this automatically.
The problem associated with insufficient or no garbage collection is that all of the memory available RAM can be allocated causing the program and the device running it to crash.
Generally, low level languages like C and C++ do not have garbage collection built into the language; although, there several GC libraries available for these languages.