We use fork/exec for running processes. Although it has some benefits regarding process isolation, it leads to higher memory demand.
For example, some of the crashes when building the compiler in 32 bits are when running the run macro to embed tool init .ecr templates.
In Go, vfork is used when available: https://github.com/golang/go/blob/master/src/syscall/exec_linux.go.
When the API is known for sure that running program needs to wait for the subprocess to finish in order to continue there could be a benefit of using vfork.
Maybe also check posix_spawn as an alternative? It internally uses vfork over fork on linux when possible.
Most helpful comment
Maybe also check posix_spawn as an alternative? It internally uses vfork over fork on linux when possible.