0x334 Runtime
1. VM
2. Garbage Collection
Interestingly, according to Wikipedia, Garbage collection was invented by John McCarthy around 1959 to simplify manual memory management in Lisp.
Tracing
This is the most common approach.
It is tracing which objects are reachable by a chain of references from certain "root" objects, and considering the rest as "garbage" and collecting them.
Reference Count
Another common approach
Hypervisor
- Type-1 Hypervisor: installed on bare metal
- Type-2 Hypervisor: installed on OS
Container
It is vital to understand that a running container shares the kernel of the hostmachine. This means Windows container needs to run on a Windows OS, linux container on a linux OS. There are exceptions: linux container can be run on Windows using Hyper-V or WSL, it can run on Mac OS using lightweight linux VM
Read this online book about Docker.