3 ms·
There's gc.freeze for that now https://docs.python.org/3/library/gc.html#gc.freeze https://docs.python.org/3/library/gc.html#gc.freeze If you load something bi
by viraptor 3y ago
There's gc.freeze for that now https://docs.python.org/3/library/gc.html#gc.freeze https://docs.python.org/3/library/gc.html#gc.freeze
If you load something big before forking workers, there's no CoW issue with that big structure anymore.
- justinc-md 3y agogc.freeze prevents considering the objects in gc, but doesn’t disable reference counting so you’ll still have CoW issues. PEP 683 introduces a way to make an object immortal which disables reference counting, which will address that issue.