gc

Internal GC interface. Currently only Documents are collected by the internal garbage collector.

Index

Classes

Debug

Debug options for the garbage collector.

Functions

collect

Explicitly call garbage collector once.

disable

Disable automatic garbage collection.

enable

Enable automatic garbage collection.

get_count

Returns the number of currently tracked objects.

get_debug

Return a copy of the current debug options of the garbage collector.

get_executor

The executor assigned to the garbage collector.

get_threshold

Return the current threshold.

is_tracked

Returns True if document is tracked by the garbage collector.

isenabled

Returns True if automatic collection is enabled.

set_debug

Set default options for the garbage collector. By default, everything is printed to stderr.

set_executor

Assign an executor to the garbage collector. Without an executor, the garbage collector always runs on the thread that invokes it, e.g. the main thread. In addition to processing documents concurrently, documents will also be destroyed asynchronously further improving performance.

set_threshold

Set the garbage collector threshold, 0 disables collection. Negative values raise ValueError.

track

Add document to garbage collector tracking list. Returns False if document was already tracked.

untrack

Remove document from the garbage collector tracking list. Returns False if document was not tracked.


󰊕 Functions

collect() None

Explicitly call garbage collector once.

disable() None

Disable automatic garbage collection.

enable() None

Enable automatic garbage collection.

get_count() int

Returns the number of currently tracked objects.

get_debug() syside.gc.Debug

Return a copy of the current debug options of the garbage collector.

get_executor() syside.Executor | None

The executor assigned to the garbage collector.

get_threshold() int

Return the current threshold.

is_tracked(arg: syside.SharedMutex[syside.BasicDocument], /) bool

Returns True if document is tracked by the garbage collector.

is_tracked(arg: syside.BasicDocument, /) bool
isenabled() bool

Returns True if automatic collection is enabled.

set_debug(arg: syside.gc.Debug, /) None

Set default options for the garbage collector. By default, everything is printed to stderr.

set_executor(arg: syside.Executor, /) None

Assign an executor to the garbage collector. Without an executor, the garbage collector always runs on the thread that invokes it, e.g. the main thread. In addition to processing documents concurrently, documents will also be destroyed asynchronously further improving performance.

set_threshold(arg: int, /) None

Set the garbage collector threshold, 0 disables collection. Negative values raise ValueError.

Garbage collector will automatically run only when it tracks more than threshold new objects since last collection.

track(arg: syside.SharedMutex[syside.BasicDocument], /) bool

Add document to garbage collector tracking list. Returns False if document was already tracked.

untrack(arg: syside.SharedMutex[syside.BasicDocument], /) bool

Remove document from the garbage collector tracking list. Returns False if document was not tracked.

untrack(arg: syside.BasicDocument, /) bool