On Mon, 21 Feb 2022 at 16:47, Larry Hastings <la...@hastings.org> wrote:
>
>
> While I don't think it's fine to play devil's advocate, given the choice 
> between "this will help a common production use-case" (pre-fork servers) and 
> "this could hurt a hypothetical production use case" (long-running 
> applications that reload modules enough times this could waste a significant 
> amount of memory), I think the former is more important.
>

Can the cost be mitigated by reusing immortal objects? So, for
instance, a module-level constant of 60*60*24*365 might be made
immortal, meaning it doesn't get disposed of with the module, but if
the module gets reloaded, no *additional* object would be created.

I'm assuming here that any/all objects unmarshalled with the module
can indeed be shared in this way. If that isn't always true, then that
would reduce the savings here.

ChrisA
_______________________________________________
Python-Dev mailing list -- python-dev@python.org
To unsubscribe send an email to python-dev-le...@python.org
https://mail.python.org/mailman3/lists/python-dev.python.org/
Message archived at 
https://mail.python.org/archives/list/python-dev@python.org/message/7XDU2THWGEX2YUD32VYY5FJXL4GFQ675/
Code of Conduct: http://python.org/psf/codeofconduct/

Reply via email to