3 ms·
> Also collection before a POSIX fork() call may free pages for future allocation which can cause copy-on-write too so it’s advised to disable gc in master proc
by wyldfire 9y ago
> Also collection before a POSIX fork() call may free pages for future allocation which can cause copy-on-write too so it’s advised to disable gc in master process and freeze before fork and enable gc in child process.
I guess it would be nice to know if optimizations like this are already covered in the high-level libraries like `multiprocessing`.
- viraptor 9y agoThey aren't / shouldn't be. This is something you need to opt into specifically because it changes behaviour. For example if you have done resource still open, calling gc.freeze will prevent it from ever cleaning up. But web frameworks should implement it.