gc
Internal GC interface. Currently only Documents are collected by the internal garbage collector.
Index
Functions
Explicitly call garbage collector once. |
||
Disable automatic garbage collection. |
||
Enable automatic garbage collection. |
||
Returns the number of currently tracked objects. |
||
Return a copy of the current debug options of the garbage collector. |
||
The executor assigned to the garbage collector. |
||
Return the current threshold. |
||
Returns |
||
Returns |
||
Set default options for the garbage collector. By default, everything is printed to stderr. |
||
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 the garbage collector threshold, 0 disables collection. Negative values raise |
||
Add document to garbage collector tracking list. Returns |
||
Remove document from the garbage collector tracking list. Returns |
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
Trueifdocumentis tracked by the garbage collector.
- is_tracked(arg: syside.BasicDocument, /) bool
- isenabled() bool
Returns
Trueif 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
Falseif document was already tracked.
- untrack(arg: syside.SharedMutex[syside.BasicDocument], /) bool
Remove document from the garbage collector tracking list. Returns
Falseif document was not tracked.
- untrack(arg: syside.BasicDocument, /) bool