[pypy-dev] Does PyPy memory use benefit from preforking?

Tin Tvrtković tinchester at gmail.com
Sat Sep 18 15:57:13 EDT 2021


Hello!

A little bit of context: roughly speaking, preforking is a technique where
a (supervisor) process is started, the process performs some initialization
and then forks off into child worker processes, which it then supervises.
It's usually used to make several worker processes share a server TCP
socket (which they inherit from the supervisor).

In some runtimes preforking can also be used to save memory since the child
processes get copy-on-write access to the supervisor memory pages. My
understanding is this doesn't actually yield anything on CPython since
essentially everything is reference counted and memory pages get copied
quickly.

PyPy doesn't use reference counting though, so I was wondering if
preforking could be used with PyPy for memory saving purposes. All of this
is a little low-level for me, and I would appreciate any insight from the
resident experts :)
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://mail.python.org/pipermail/pypy-dev/attachments/20210918/22fd80ff/attachment.html>


More information about the pypy-dev mailing list