Zekun Li <li.ze...@gmail.com> added the comment:

So what we did is:

We keep gc **disabled** on parent process and freeze after warmup, enable gc on 
child process.

The reason not to do a full collection is mentioned in previous 
comments/original ticket - (I called it) memory fragmentation.

The observation is - We keep gc disabled on both parent and child process and 
did a full collection before fork, it makes the shared memory shrink a lot 
compared to no collection. - There's no way for disabled gc to touch the head 
to make copy-on-write.

Of course, enable gc will make the shared memory shrink more. But the former 
case is accounting more than latter one.

So my understand is that gc frees some objects and makes some memory pages 
becomes available to allocate in child process. Allocation on the shared memory 
pages will cause the copy-on-write even without gc.

Though this behavior may have better name?

----------

_______________________________________
Python tracker <rep...@bugs.python.org>
<https://bugs.python.org/issue31558>
_______________________________________
_______________________________________________
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com

Reply via email to