-
Notifications
You must be signed in to change notification settings - Fork 262
Closed
Description
OGA Memory Leak — Model and Tokenizer Instances Not Disposed
Severity: Warning
Component: ONNX GenAI Runtime (OGA)
Reproduction: Run any example to completion — the leak message appears on process exit
OGA Error: 1 instances of struct Generators::Model were leaked.
OGA Error: 1 instances of struct Generators::Tokenizer were leaked.
Please see the documentation for the API being used to ensure proper cleanup.
In the Whisper scenario, the leak count was higher:
OGA Error: 1 instances of struct Generators::Model were leaked.
OGA Error: 2 instances of struct Generators::Tokenizer were leaked.
Impact: The Foundry Local SDK does not expose a Dispose() or Unload() method for models in the C# API. There is no documented way for application code to release these native resources.
Expected: Either:
- Expose
IDisposable/IAsyncDisposableon the model or manager objects, or - Suppress the leak warnings when the SDK is managing the lifecycle, or
- Document the proper cleanup pattern.
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
No labels