On this page
  1. gc.set_threshold
  2. Import
  3. Signature & Overview
  4. Usage
  5. Gotchas
  6. REPL Inspect

gc.set_threshold

Prev: gc.set_debug | Up: gc | Next: gc.unfreeze
Rel: gc.collect, gc.disable, gc.enable, gc.freeze
Ref: docs.python.org — gc.set_threshold
Tags: #public #python3 #stdlib #gc


Import

import gc
from gc import set_threshold

Signature & Overview

gc.set_threshold(threshold0, [threshold1, [threshold2]])

Set the collection thresholds (the collection frequency).

Usage

import gc

old = gc.get_threshold()
gc.set_threshold(*old)
assert gc.get_threshold() == old

Gotchas

REPL Inspect

from gc import set_threshold
help(set_threshold)

Linked from

Related notes