bpo-32759: Free unused arenas in multiprocessing.heap#5827
Merged
pitrou merged 3 commits intopython:masterfrom Apr 9, 2018
Merged
bpo-32759: Free unused arenas in multiprocessing.heap#5827pitrou merged 3 commits intopython:masterfrom
pitrou merged 3 commits intopython:masterfrom
Conversation
Large shared arrays allocated using multiprocessing would remain allocated until the process ends.
Member
serhiy-storchaka
left a comment
There was a problem hiding this comment.
I started reviewing yesterday, but it will take some time to grok this code.
Lib/multiprocessing/heap.py
Outdated
| if new_stop < stop: | ||
| self._free((arena, new_stop, stop)) | ||
| self._add_free_block((arena, new_stop, stop)) | ||
| block = (arena, start, new_stop) |
Member
There was a problem hiding this comment.
The block variable can be inlined now.
Member
Author
Yes, it's a mini-memory allocator here. Not too complex fortunately. |
Member
Author
|
I adressed the review comment and added some comments to try and explain the allocator a bit more. If there are no further review comments, I will merge this PR. |
serhiy-storchaka
approved these changes
Apr 9, 2018
Member
Author
|
Thank you @serhiy-storchaka :-) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Large shared arrays allocated using multiprocessing would remain allocated
until the process ends.
https://bugs.python.org/issue32759