5 Garbage collection

Some languages, such as Java, Perl, PHP and many others, support garbage collection. This is a method to handle dynamically allocated memory without pointers.

Instead, the concept of a handle is introduced. A handle differs from a pointer in many ways.

 5.1 Handle
 5.2 Allocated objects
 5.3 Marking used memory
 5.4 Sweeping
 5.5 Can we do this in C/C++?