3 ms·
https://docs.python.org/3.7/library/gc.html#gc.freeze https://docs.python.org/3.7/library/gc.html#gc.freeze Documentation link for anyone that is interested
by orf 9y ago
https://docs.python.org/3.7/library/gc.html#gc.freeze https://docs.python.org/3.7/library/gc.html#gc.freeze
Documentation link for anyone that is interested
- rojoca 9y agoAlso the source(?) of this change from instagram: https://engineering.instagram.com/copy-on-write-friendly-python-garbage-collection-ad6ed5233ddf https://engineering.instagram.com/copy-on-write-friendly-pyt...
- 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.