Skip to content

Conversation

alcaeus
Copy link
Owner

@alcaeus alcaeus commented Nov 7, 2019

The cursor classes wrap a given traversable in a generator. However, even when the cursors are garbage collected, the generator itself sometimes stays around and thus causes a memory leak. Thus, we remove our reference to the generator when destructing the cursor which also allows freeing the underlying MongoDB cursor object.

@alcaeus alcaeus added the bug label Nov 7, 2019
@alcaeus alcaeus self-assigned this Nov 7, 2019
@alcaeus alcaeus changed the title Remove reference to generators on cursor destruction Fix memory leak due to partially iterated generators Nov 11, 2019
@alcaeus alcaeus added this to the 1.1.11 milestone Nov 11, 2019
@alcaeus alcaeus merged commit 15ba371 into master Nov 11, 2019
@alcaeus alcaeus deleted the fix-generator-memory-leak branch November 11, 2019 13:54
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant