Skip to content

BUG: Fix memory leak when slicing Series and assigning to self #61426

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

Open
wants to merge 3 commits into
base: main
Choose a base branch
from

Conversation

niranjanorkat
Copy link

This PR fixes a memory leak that occurs when a Series is sliced and reassigned to itself, e.g., a = a[-1:].

The underlying BlockManager retained references to the original data, preventing garbage collection. This is resolved by ensuring the sliced result copies the backing data.

Closes #60640.

@niranjanorkat niranjanorkat force-pushed the fix-memory-leak-slice branch from 876719e to eae8ff6 Compare May 10, 2025 16:59
@niranjanorkat niranjanorkat force-pushed the fix-memory-leak-slice branch from eae8ff6 to e787447 Compare May 10, 2025 17:06
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.

BUG: memory leak when slice series var assigning to itself
1 participant