Skip to content

Commit a36efb6

Browse files
committed
pure on free?
1 parent a8e2a42 commit a36efb6

1 file changed

Lines changed: 4 additions & 1 deletion

File tree

‎Objects/mimalloc/arena/arena-alloc.c‎

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -340,7 +340,10 @@ void _mi_arenas_free(mi_subproc_t* subproc, void* p, size_t size, mi_memid_t mem
340340
}
341341

342342
// try to purge expired decommits
343-
// mi_arenas_try_purge(false, false, NULL);
343+
// CPython: purge on free as in mimalloc v2; otherwise freed memory is only
344+
// purged on periodic theap collects and stays resident long after its purge
345+
// delay expired, which increases peak RSS of short-running processes.
346+
mi_arenas_try_purge(false, false, subproc, 0);
344347
}
345348

346349
// Purge the arenas; if `force_purge` is true, amenable parts are purged even if not yet expired

0 commit comments

Comments
 (0)