Memory leakage in with_columns and computation of statistics #20851
Labels
bug
Something isn't working
needs triage
Awaiting prioritization by a maintainer
python
Related to Python Polars
Checks
Reproducible example
Description
When performing iterative operations on Polars DataFrames that involve complex transformations (e.g., rolling statistics with grouping), memory usage increases over time and is not fully released even after explicitly deleting the DataFrame and invoking gc.collect(). This issue persists across thousands of iterations, eventually leading to increased memory consumption.
Steps to Reproduce
Log output
Issue description
Memory usage increases gradually across iterations. Even after deleting the DataFrame and calling gc.collect(), memory is not released.
I have not found a workaround.
Enabling or disabling string caching (pl.enable_string_cache()) does not seem to affect the outcome.
Expected behavior
Memory usage should stabilize as the DataFrame is deleted and garbage collection is triggered. The memory should not grow continuously if no new data is being held.
Installed versions
The text was updated successfully, but these errors were encountered: