diff options
author | Mark Shannon <mark@hotpy.org> | 2024-02-05 18:28:51 (GMT) |
---|---|---|
committer | GitHub <noreply@github.com> | 2024-02-05 18:28:51 (GMT) |
commit | 36518e69d74607e5f094ce55286188e4545a947d (patch) | |
tree | b031b3cb351b68e5bee0ad4bf346fd958b2b9307 /Doc | |
parent | b4ba0f73d6eef3da321bb96aafd09dfbc572e95d (diff) | |
download | cpython-36518e69d74607e5f094ce55286188e4545a947d.zip cpython-36518e69d74607e5f094ce55286188e4545a947d.tar.gz cpython-36518e69d74607e5f094ce55286188e4545a947d.tar.bz2 |
GH-108362: Incremental GC implementation (GH-108038)
Diffstat (limited to 'Doc')
-rw-r--r-- | Doc/whatsnew/3.13.rst | 34 |
1 files changed, 34 insertions, 0 deletions
diff --git a/Doc/whatsnew/3.13.rst b/Doc/whatsnew/3.13.rst index c25d413..0770e28 100644 --- a/Doc/whatsnew/3.13.rst +++ b/Doc/whatsnew/3.13.rst @@ -92,6 +92,10 @@ Interpreter improvements: New Features ============ +* The cyclic garbage collector is now incremental. + This means that maximum pause times are reduced, + by an order of magnitude or more for larger heaps. + Improved Error Messages ----------------------- @@ -101,6 +105,13 @@ Improved Error Messages variables. See also :ref:`using-on-controlling-color`. (Contributed by Pablo Galindo Salgado in :gh:`112730`.) +Incremental Garbage Collection +------------------------------ + +* The cycle garbage collector is now incremental. + This means that maximum pause times are reduced + by an order of magnitude or more for larger heaps. + Other Language Changes ====================== @@ -232,6 +243,29 @@ fractions sign handling, minimum width and grouping. (Contributed by Mark Dickinson in :gh:`111320`.) +gc +-- +* The cyclic garbage collector is now incremental, which changes the meanings + of the results of :meth:`gc.get_threshold` and :meth:`gc.get_threshold` as + well as :meth:`gc.get_count` and :meth:`gc.get_stats`. +* :meth:`gc.get_threshold` returns a three-tuple for backwards compatibility, + the first value is the threshold for young collections, as before, the second + value determines the rate at which the old collection is scanned; the + default is 10 and higher values mean that the old collection is scanned more slowly. + The third value is meangless and is always zero. +* :meth:`gc.set_threshold` ignores any items after the second. +* :meth:`gc.get_count` and :meth:`gc.get_stats`. + These functions return the same format of results as before. + The only difference is that instead of the results refering to + the young, aging and old generations, the results refer to the + young generation and the aging and collecting spaces of the old generation. + +In summary, code that attempted to manipulate the behavior of the cycle GC may +not work as well as intended, but it is very unlikely to harmful. +All other code will work just fine. +Uses should avoid calling :meth:`gc.collect` unless their workload is episodic, +but that has always been the case to some extent. + glob ---- |