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

2021-09-24 Thread Maciej Fijalkowski
Hi Tin

As far as I remember PyPy has GC headers that have various bits set
and cleared when walking the heap for garbage collection, so while it
does not use reference counting, it would not benefit really from
pre-forking either. There are some ideas how to make that work, btu
none of them have been implemented.

Best,
Maciej Fijalkowski

On Sat, 18 Sept 2021 at 21:58, Tin Tvrtković  wrote:
>
> 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 :)
> ___
> pypy-dev mailing list
> pypy-dev@python.org
> https://mail.python.org/mailman/listinfo/pypy-dev
___
pypy-dev mailing list
pypy-dev@python.org
https://mail.python.org/mailman/listinfo/pypy-dev


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

2021-09-18 Thread Tin Tvrtković
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 :)
___
pypy-dev mailing list
pypy-dev@python.org
https://mail.python.org/mailman/listinfo/pypy-dev