How a fork starts
One way to make a fork is to restore a snapshot. Firecracker, the open-source virtual machine monitor from AWS, saves the guest memory and the emulated hardware state of a microVM. The saved state can be loaded later in a different Firecracker process.
Why copies can share memory
Firecracker lets several microVMs share memory pages and read-only disks from one snapshot. A memory write after the restore goes to a copy-on-write mapping. One copy does not change the memory of another.
Same state, same random values
The Firecracker snapshot documentation says that resuming the same state more than once is insecure. Random numbers, unique IDs and one-time tokens may then be used twice. Check how each fork gets new random values and new identifiers.
Common uses
- Try many fixes in parallel from the same starting state.
- Branch the work of an agent, so one path can continue while another is tested.
What to check on a provider
- Whether a fork keeps the memory, the files only, or both.
- How many forks you may run at once, and whether the limit is a concurrency limit.
- How each fork is billed, and whether the original sandbox keeps running.