From ea72aae75d13baf778a6eac95a588fd3c736920b Mon Sep 17 00:00:00 2001 From: Brandt Bucher Date: Sun, 23 Nov 2025 19:42:40 -0800 Subject: [PATCH 1/2] Fix double-counting of marked objects --- Python/gc.c | 1 - 1 file changed, 1 deletion(-) diff --git a/Python/gc.c b/Python/gc.c index d067a6144b0763..b1bf308b9c4f73 100644 --- a/Python/gc.c +++ b/Python/gc.c @@ -1618,7 +1618,6 @@ mark_at_start(PyThreadState *tstate) PyGC_Head *visited = &gcstate->old[gcstate->visited_space].head; Py_ssize_t objects_marked = mark_global_roots(tstate->interp, visited, gcstate->visited_space); objects_marked += mark_stacks(tstate->interp, visited, gcstate->visited_space, true); - gcstate->work_to_do -= objects_marked; gcstate->phase = GC_PHASE_COLLECT; validate_spaces(gcstate); return objects_marked; From 727f9a56b3912cded3337336407d4c1099191c39 Mon Sep 17 00:00:00 2001 From: Brandt Bucher Date: Sun, 23 Nov 2025 19:45:58 -0800 Subject: [PATCH 2/2] blurb add --- .../2025-11-23-19-45-49.gh-issue-141890.99IS5Y.rst | 2 ++ 1 file changed, 2 insertions(+) create mode 100644 Misc/NEWS.d/next/Core_and_Builtins/2025-11-23-19-45-49.gh-issue-141890.99IS5Y.rst diff --git a/Misc/NEWS.d/next/Core_and_Builtins/2025-11-23-19-45-49.gh-issue-141890.99IS5Y.rst b/Misc/NEWS.d/next/Core_and_Builtins/2025-11-23-19-45-49.gh-issue-141890.99IS5Y.rst new file mode 100644 index 00000000000000..0e6c4dd907dddd --- /dev/null +++ b/Misc/NEWS.d/next/Core_and_Builtins/2025-11-23-19-45-49.gh-issue-141890.99IS5Y.rst @@ -0,0 +1,2 @@ +Fix an issue where garbage collection could run less frequently than +expected.