[Python-Dev] The untuned tunable parameter ARENA_SIZE (original) (raw)

INADA Naoki songofacandy at gmail.com
Thu Jun 1 04:23:04 EDT 2017


Hello.

AFAIK, allocating arena doesn't eat real (physical) memory.

Arena size is more important for freeing memory. Python returns memory to system when:

  1. When no block in pool is used, it returned to arena.
  2. When no pool is used, return the arena to system.

So only one memory block can disturb returning the whole arena.

Some VMs (e.g. mono) uses special APIs to return "real page" from allocated space.

See also:

https://github.com/corngood/mono/blob/ef186403b5e95a5c95c38f1f19d0c8d061f2ac37/mono/utils/mono-mmap.c#L204-L208 (Windows) https://github.com/corngood/mono/blob/ef186403b5e95a5c95c38f1f19d0c8d061f2ac37/mono/utils/mono-mmap.c#L410-L424 (Unix)

I think we can return not recently used free pools to system in same way. So more large arena size + more memory efficient can be achieved.

But I need more experiment.

Regards,



More information about the Python-Dev mailing list