GeezerVisonThe World Wide Web, restored to 800 pixels of glory. | ||||||||||||||||||||
| Home|About|Gaming cabinet|Archives|How it works|Starter sites | ||||||||||||||||||||
GeezerVison is showing github.com — gh-161420: Process mimalloc's delayed frees on every generic malloc again by maikschulze · Pull Request #161533 · python/cpython Conversation
|
| Peak RSS | main |
this PR |
|---|---|---|
| macOS | 5,900–8,000 MiB | 410–500 MiB |
| Linux | 9,500–11,000 MiB | 420–540 MiB |
| Windows | 8,000–8,200 MiB | 430–450 MiB |
No measurable difference for small objects (pyperf, macOS and Linux).
I used an AI assistant to investigate this and draft the patch; I reviewed and tested the changes myself.
Sorry, something went wrong.
There was an error while loading. Please reload this page.
…lloc again Since the update to mimalloc 2.5.2 (pythongh-159111), _mi_malloc_generic() processes the heap's delayed frees only every 100 calls. A block over MI_MEDIUM_OBJ_SIZE_MAX has a page of its own, so a free of it from another thread is a delayed free, and every allocation of such a block is a generic malloc: each thread could keep up to about 100 large blocks that other threads had freed. Process the delayed frees on every generic malloc again, as mimalloc 2.1 did; the deferred-free callback and the periodic collection stay batched.
There was an error while loading. Please reload this page.
There was an error while loading. Please reload this page.
There was a problem hiding this comment.
The reason will be displayed to describe this comment to others. Learn more.
Please write descption to be concisely as possible.
Sorry, something went wrong.
There was an error while loading. Please reload this page.
|
A Python core developer has requested some changes be made to your pull request before we can consider merging it. If you could please address their requests along with any other requests in other reviews from core developers that would be appreciated. Once you have made the requested changes, please leave a comment on this pull request containing the phrase |
Sorry, something went wrong.
There was an error while loading. Please reload this page.
Co-authored-by: Donghee Na <[email protected]>
There was an error while loading. Please reload this page.
Sorry, something went wrong.
There was an error while loading. Please reload this page.
|
I have made the requested changes; please review again |
Sorry, something went wrong.
There was an error while loading. Please reload this page.
|
Thanks for making the requested changes! @corona10: please review the changes made to this pull request. |
Sorry, something went wrong.
There was an error while loading. Please reload this page.
There was a problem hiding this comment.
The reason will be displayed to describe this comment to others. Learn more.
lgtm!
Sorry, something went wrong.
There was an error while loading. Please reload this page.
There was an error while loading. Please reload this page.
|
Thanks @maikschulze for the PR, and @corona10 for merging it 🌮🎉.. I'm working now to backport this PR to: 3.14, 3.15. |
Sorry, something went wrong.
There was an error while loading. Please reload this page.
|
GH-161537 is a backport of this pull request to the 3.15 branch. |
Sorry, something went wrong.
There was an error while loading. Please reload this page.
|
GH-161538 is a backport of this pull request to the 3.14 branch. |
Sorry, something went wrong.
There was an error while loading. Please reload this page.
|
@corona10: Should we keep track of mimalloc 2.5 downstream changes made in Python? Should the change be reported and fixed to mimalloc upstream? |
Sorry, something went wrong.
There was an error while loading. Please reload this page.
|
It’s already reported in microsoft/mimalloc#1117. And comments starts with “CPython:” in mimalloc of CPython repo means that it’s our downstream modification, so it’s already tracked. |
Sorry, something went wrong.
There was an error while loading. Please reload this page.
There was an error while loading. Please reload this page.
Successfully merging this pull request may close these issues.
There was an error while loading. Please reload this page.