On this page
gc.get_threshold
Prev: gc.get_stats | Up: gc | Next: gc.is_finalized
Rel: gc.collect, gc.disable, gc.enable, gc.freeze
Ref: docs.python.org — gc.get_threshold
Tags: #public #python3 #stdlib #gc
Import
import gc
from gc import get_threshold
Signature & Overview
gc.get_threshold()
Return the current collection thresholds.
Usage
import gc
t0, t1, t2 = gc.get_threshold()
assert t0 > 0
Gotchas
- Default is
(700, 10, 10)(or(2000, 10, 0)in incremental GC on Python 3.14+).
REPL Inspect
from gc import get_threshold
help(get_threshold)
Linked from
Related notes
- tuts/python3/stdlib_module/gc/get_stats Linked here; links to this page; shared tags: #gc, #stdlib
- tuts/python3/stdlib_module/gc/is_finalized Linked here; links to this page; shared tags: #gc, #stdlib
- tuts/python3/stdlib_module/gc Linked here; links to this page; shared tags: #stdlib
- tuts/python3/stdlib_module/gc/collect Linked here; shared tags: #gc, #stdlib
- tuts/python3/stdlib_module/gc/disable Linked here; shared tags: #gc, #stdlib
- tuts/python3/stdlib_module/gc/enable Linked here; shared tags: #gc, #stdlib
- tuts/python3/stdlib_module/gc/freeze Linked here; shared tags: #gc, #stdlib
- tuts/python3/stdlib_module/gc/get_count shared tags: #gc, #stdlib
- tuts/python3/stdlib_module/gc/get_debug shared tags: #gc, #stdlib
- tuts/python3/stdlib_module/gc/get_freeze_count shared tags: #gc, #stdlib