Skip to content

[DOC] Document ReleaseEnv memory leak limitation before v1.0 #21

@tazarov

Description

@tazarov

Description

The current implementation has a known memory leak in DestroyEnvironment() because ReleaseEnv is disabled (see issue #20). This limitation must be prominently documented in user-facing documentation before any production use.

Background

From PR #15 review:

The ReleaseEnv function is currently disabled, meaning every environment creation leaks memory. This is acceptable for short-lived processes but CRITICAL for long-running applications.

Required Documentation Updates

1. README.md - Add Limitations Section

Add a prominent "Known Limitations" or "Current Status" section near the top:

## ⚠️ Current Limitations

**Not Production Ready**: This library is under active development and has known limitations:

- **Memory Leak**: The current implementation leaks memory on `DestroyEnvironment()` due to incomplete ORT API struct mapping (see #20)
  - **Impact**: Not suitable for long-running applications that repeatedly create/destroy environments
  - **Acceptable for**: Short-lived processes, testing, development
  - **Status**: Tracked in #20, must be fixed before v1.0

See [LIMITATIONS.md](LIMITATIONS.md) for full details.

2. Create LIMITATIONS.md

Document all known limitations with:

  • Clear description of each issue
  • Impact assessment
  • Workarounds if any
  • Timeline for fixes
  • Link to tracking issue

3. Update environment.go godoc

Add warning to InitializeEnvironment() documentation:

// InitializeEnvironment initializes the ONNX Runtime environment.
//
// WARNING: Current implementation has a memory leak on DestroyEnvironment().
// Not recommended for long-running applications that repeatedly init/destroy.
// See: https://github.com/amikos-tech/pure-onnx/issues/20
//
// This function uses reference counting, so multiple calls are safe.

4. Update TESTING.md

Document that integration tests should verify cleanup once #20 is fixed.

Acceptance Criteria

Priority

High - Must be done before v1.0 or any production recommendation

Related Issues

Metadata

Metadata

Assignees

No one assigned

    Labels

    documentationImprovements or additions to documentation

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions