Skip to main content

Performance & Memory Management

Ingestion connectors run inside containers with fixed memory limits. Failing to handle pagination, memory cleanup, or resource management causes silent data loss or OOM crashes in production. These are the most critical patterns to follow.

Pagination (Required)

Every client method that fetches a list of entities from a REST API must implement pagination if the API supports it. Missing pagination is the most dangerous bug in connectors — it silently returns only the first page of results with no error.
Missing pagination on a paginated API is a blocker in code review. Users see partial metadata and assume it’s complete — this is silent data loss.

Lookup Optimization

When you need to look up entities by ID or path during iteration, build a dictionary once and use O(1) lookups — don’t iterate a list every time.

Memory Management

Connectors that read files (storage connectors especially) or process large query results must manage memory carefully to avoid OOM:
  1. Never load entire files without a size check:
  1. Delete large objects after processing and call gc.collect():
  1. Use generators in yield methods — don’t accumulate results in a list:
  1. Bound all caches — use lru_cache(maxsize=) or clear between scopes:
  1. Stream query results — use .fetchmany(), not .all() on large tables:

Connection Reuse

REST clients should create one requests.Session and reuse it for all requests:
For the full performance and memory standards with detailed patterns, see skills/standards/performance.md and skills/standards/memory.md in the OpenMetadata repository.

Next Step

With the Code ready to go, we can now proceed to make a small change in the UI to be able to configure the Connector properly from there.

Apply the UI Changes

Learn what you need to do to be able see the Connector properly in the UI