Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Memory leak in memoryview iterator #92804

Closed
kumaraditya303 opened this issue May 14, 2022 · 1 comment · Fixed by #92805
Closed

Memory leak in memoryview iterator #92804

kumaraditya303 opened this issue May 14, 2022 · 1 comment · Fixed by #92805
Assignees
Labels
3.11 3.12 type-bug

Comments

@kumaraditya303
Copy link
Contributor

@kumaraditya303 kumaraditya303 commented May 14, 2022

memoryview iterator leaks memory at exit as it is not finalized.

Reproducer:

print(type(iter(memoryview(b'abc'))).mro())

Memory leak:

@kumaraditya303 ➜ /workspaces/cpython (main ✗) $ ./python -X showrefcount main.py 
[<class 'memory_iterator'>, <class 'object'>]
[123 refs, 47 blocks]
@kumaraditya303 kumaraditya303 self-assigned this May 14, 2022
@kumaraditya303 kumaraditya303 added the type-bug label May 14, 2022
miss-islington pushed a commit to miss-islington/cpython that referenced this issue May 14, 2022
(cherry picked from commit d923fdf)

Co-authored-by: Kumar Aditya <59607654+kumaraditya303@users.noreply.github.com>
@corona10
Copy link
Member

@corona10 corona10 commented May 14, 2022

$> ./python.exe -X showrefcount gh-92804.py
[<class 'memory_iterator'>, <class 'object'>]
[0 refs, 0 blocks]

Now the issue is fixed, Thanks @kumaraditya303

miss-islington added a commit that referenced this issue May 14, 2022
(cherry picked from commit d923fdf)

Co-authored-by: Kumar Aditya <59607654+kumaraditya303@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
3.11 3.12 type-bug
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants