User:Trustable/Memory management

This page should explain different techniques of Memory management in programming languages.

Manual memory management
E.g.  and   in C.

Cons:
 * No protection of memory leaks
 * No protection of use after free bugs

Tracing garbage collection
Used by:
 * Java
 * JavaScript
 * Common Language Runtime
 * Go
 * many more

Cons:
 * Runtime costs

Reference counting with tracing garbage collection
The tracing part is needed for cycle detection.

Used by:
 * Python
 * PHP
 * Nim

Cons:
 * Runtime costs

Reference counting with ownership
Used by:
 * C++
 * Rust
 * Swift
 * Nim (ORC) (more info)
 * V

Cons:
 * Runtime costs