]> granicus.if.org Git - python/commit
bpo-37257: obmalloc: stop simple arena thrashing (#14039)
authorTim Peters <tim.peters@gmail.com>
Thu, 13 Jun 2019 03:41:03 +0000 (22:41 -0500)
committerGitHub <noreply@github.com>
Thu, 13 Jun 2019 03:41:03 +0000 (22:41 -0500)
commitd1c85a27ea9fe70163cad3443d5e534d94f08284
tree394e4c7c33491d4fc88b8cc5ce2898618430858a
parent3a2883c313be3aff34c61a42e586f8507ba5945f
bpo-37257:  obmalloc:  stop simple arena thrashing (#14039)

GH-14039:  allow (no more than) one wholly empty arena on the usable_arenas list.

This prevents thrashing in some easily-provoked simple cases that could end up creating and destroying an arena on each loop iteration in client code.   Intuitively, if the only arena on the list becomes empty, it makes scant sense to give it back to the system unless we know we'll never need another free pool again before another arena frees a pool.  If the latter obtains, then - yes - this will "waste" an arena.
Misc/NEWS.d/next/Core and Builtins/2019-06-13-02-27-12.bpo-37257.IMxDvT.rst [new file with mode: 0644]
Objects/obmalloc.c