From 36525e33041ac1e3c9c84ec1b6b40185df0916c6 Mon Sep 17 00:00:00 2001 From: Egor Dranischnikow Date: Thu, 14 Oct 2021 22:00:33 +0200 Subject: [PATCH 1/2] fixing leak in aggregation.pyx --- pandas/_libs/window/aggregations.pyx | 2 ++ 1 file changed, 2 insertions(+) diff --git a/pandas/_libs/window/aggregations.pyx b/pandas/_libs/window/aggregations.pyx index 1941a3c4a37f0..98201a6f58499 100644 --- a/pandas/_libs/window/aggregations.pyx +++ b/pandas/_libs/window/aggregations.pyx @@ -835,6 +835,7 @@ def roll_median_c(const float64_t[:] values, ndarray[int64_t] start, if not is_monotonic_increasing_bounds: nobs = 0 + skiplist_destroy(sl) sl = skiplist_init(win) skiplist_destroy(sl) @@ -1070,6 +1071,7 @@ def roll_quantile(const float64_t[:] values, ndarray[int64_t] start, if i == 0 or not is_monotonic_increasing_bounds: if not is_monotonic_increasing_bounds: nobs = 0 + skiplist_destroy(skiplist) skiplist = skiplist_init(win) # setup From e0967cbd90aca8facfdc86755520e34b62d700fb Mon Sep 17 00:00:00 2001 From: Egor Dranischnikow Date: Sat, 16 Oct 2021 18:42:28 +0200 Subject: [PATCH 2/2] adding whatsnew 1.3.4 --- doc/source/whatsnew/v1.3.4.rst | 1 + 1 file changed, 1 insertion(+) diff --git a/doc/source/whatsnew/v1.3.4.rst b/doc/source/whatsnew/v1.3.4.rst index 9c9aacc4b0f52..b6ee2d57a0965 100644 --- a/doc/source/whatsnew/v1.3.4.rst +++ b/doc/source/whatsnew/v1.3.4.rst @@ -35,6 +35,7 @@ Bug fixes ~~~~~~~~~ - Fixed bug in :meth:`.GroupBy.mean` with datetimelike values including ``NaT`` values returning incorrect results (:issue:`43132`) - Fixed bug in :meth:`Series.aggregate` not passing the first ``args`` to the user supplied ``func`` in certain cases (:issue:`43357`) +- Fixed memory leaks in :meth:`Series.rolling.quantile` and :meth:`Series.rolling.median` (:issue:`43339`) .. ---------------------------------------------------------------------------