Pickle caching objects?

José María Mateos chema at rinzewind.org
Sun Dec 1 09:39:56 EST 2019


On Sun, Dec 01, 2019 at 12:26:15PM +1100, Chris Angelico wrote:
>I can't answer your question authoritatively, but I can suggest a
>place to look. Python's memory allocator doesn't always return memory
>to the system when the objects are freed up, for various reasons
>including the way that memory pages get allocated from. But it
>internally knows which parts are in use and which parts aren't. You're
>seeing the RSS go down slightly at some points, which would be the
>times when entire pages can be released; but other than that, what
>you'll end up with is a sort of high-water-mark with lots of unused
>space inside it.
>
>So what you're seeing isn't actual objects being cached, but just
>memory ready to be populated with future objects.

Thank you and Richard for your responses, this makes perfect sense now.

Cheers,

-- 
José María (Chema) Mateos || https://rinzewind.org/


More information about the Python-list mailing list