Skip to content

bpo-32759: Free unused arenas in multiprocessing.heap#5827

Merged
pitrou merged 3 commits intopython:masterfrom
pitrou:mp_heap_arena_free
Apr 9, 2018
Merged

bpo-32759: Free unused arenas in multiprocessing.heap#5827
pitrou merged 3 commits intopython:masterfrom
pitrou:mp_heap_arena_free

Conversation

@pitrou
Copy link
Copy Markdown
Member

@pitrou pitrou commented Feb 23, 2018

Large shared arrays allocated using multiprocessing would remain allocated
until the process ends.

https://bugs.python.org/issue32759

Large shared arrays allocated using multiprocessing would remain allocated
until the process ends.
Copy link
Copy Markdown
Member

@serhiy-storchaka serhiy-storchaka left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I started reviewing yesterday, but it will take some time to grok this code.

if new_stop < stop:
self._free((arena, new_stop, stop))
self._add_free_block((arena, new_stop, stop))
block = (arena, start, new_stop)
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The block variable can be inlined now.

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Indeed :-)

@pitrou
Copy link
Copy Markdown
Member Author

pitrou commented Mar 1, 2018

but it will take some time to grok this code.

Yes, it's a mini-memory allocator here. Not too complex fortunately.

@pitrou
Copy link
Copy Markdown
Member Author

pitrou commented Apr 8, 2018

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.

@pitrou
Copy link
Copy Markdown
Member Author

pitrou commented Apr 9, 2018

Thank you @serhiy-storchaka :-)

@pitrou pitrou merged commit e4679cd into python:master Apr 9, 2018
@pitrou pitrou deleted the mp_heap_arena_free branch April 9, 2018 15:37
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants