> This page is for version 0.5.0 · 26.06.
> For other versions, use one of these documentation indexes:
> - Nightly (default): https://docs.nvidia.com/nemo/automodel/nightly/llms.txt
> - Latest: https://docs.nvidia.com/nemo/automodel/latest/llms.txt
> - 0.5.0 · 26.06: https://docs.nvidia.com/nemo/automodel/v0.5/llms.txt
> - 0.4.0 · 26.04: https://docs.nvidia.com/nemo/automodel/v0.4/llms.txt

> For clean Markdown of any page, append .md to the page URL.
> For a complete documentation index, see https://docs.nvidia.com/nemo/automodel/llms.txt.
> For AI client integration (Claude Code, Cursor, etc.), connect to the MCP server at https://docs.nvidia.com/nemo/automodel/_mcp/server.

# nemo_automodel.components.training.garbage_collection

## Module Contents

### Classes

| Name                                                                                            | Description                                                     |
| ----------------------------------------------------------------------------------------------- | --------------------------------------------------------------- |
| [`GarbageCollection`](#nemo_automodel-components-training-garbage_collection-GarbageCollection) | Utility for periodic manual garbage collection during training. |

### Data

[`logger`](#nemo_automodel-components-training-garbage_collection-logger)

### API

```python
class nemo_automodel.components.training.garbage_collection.GarbageCollection(
    gc_every_steps: int = 1000
)
```

Utility for periodic manual garbage collection during training.

```python
nemo_automodel.components.training.garbage_collection.GarbageCollection.collect(
    reason: str,
    generation: int = 1
) -> None
```

staticmethod

Collect garbage and emit timing logs.

```python
nemo_automodel.components.training.garbage_collection.GarbageCollection.run(
    step_count: int
) -> None
```

Run periodic garbage collection based on step count.

```python
nemo_automodel.components.training.garbage_collection.logger = logging.getLogger(__name__)
```