-
Notifications
You must be signed in to change notification settings - Fork 27
FIX memoryview leaks and retrofit memory-manager as context-managers #33
New issue
Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? # to your account
base: master
Are you sure you want to change the base?
Conversation
+ Possible fixing gitpython-developers#31 by stop decrement on destruction, rely only on `with...` resources. + feat(mmap): utility to check if regions have been closed (PY3-only).
+ Add PY3 compat utilities + doc(changes, tutorial): update on mman usage
+ doc(tutorial): update use-cases + doc(changes): new bullet.
+ feat(mman): report missed exits.
+ All gitdb TCs now pass without explit release!
1 similar comment
@Byron can you check these lines where a It took me the half month to realize that this is leaking badly, and I want you to check the history of this commits leading up to it, because I cannot understand whether they were mistake or intentional, and what would be the repercussions (ie, performance?). |
@ankostis Sorry for the very late reply. I am no holiday now, and am working through everything that piled up. |
Yes, it is a python-3 issue, because the destructors are not deterministic. Now, in python3, you can slice memmaps as if they were |
If using direct access would be a solution, then it probably should be used instead. Correctness over performance I would say. |
BREAKING API:
retrofit
git.util.mman
as context-manager,to release memory-mapped regions held.
The mmap-manager(s) are re-entrant, but not thread-safe context-manager(s),
to be used within a
with ...:
block, ensuring any left-overs cursors are cleaned up.If not entered, :meth:
StaticWindowMapManager.make_cursor()
and/or:meth:
WindowCursor.use_region()
will scream.Get them from
smmap.managed_mmaps()
.Simplify :class:
SlidingWindowMapBuffer
as create/close context-manager(no
begin_access()
, orend_access()
).