Skip to content

Conversation

@sgrebnov
Copy link

@sgrebnov sgrebnov commented Jan 13, 2026

🗣 Description

Temporarily disable child registration in child_with_tags() to prevent memory growth in long-lived VortexSession instances. The children Vec accumulates indefinitely with strong references never cleared.

Root cause:
VortexSession → VortexMetrics (root)
└─> children: RwLock<Vec> ← NEVER CLEARED

Each query creates child VortexMetrics (one per partition × files) that are registered with the session's root metrics and persist for the session lifetime, causing OOM in high-throughput scenarios.

Impact:

  • Only bench-vortex is affected --show-metrics loses per-partition/per-file breakdown
  • Root-level aggregated metrics still work
  • No impact on EXPLAIN ANALYZE or production query execution

Vortex tracking issue:

🔨 Related Issues

🤔 Concerns

@sgrebnov sgrebnov self-assigned this Jan 13, 2026
@sgrebnov sgrebnov marked this pull request as ready for review January 13, 2026 20:49
Copilot AI review requested due to automatic review settings January 13, 2026 20:49
Copy link

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR temporarily disables child metric registration in the VortexMetrics::child_with_tags() method to prevent memory leaks caused by indefinite accumulation of child metrics in long-lived VortexSession instances. The change addresses an OOM issue in high-throughput scenarios where each query creates multiple child VortexMetrics instances (per partition and file) that persist for the session lifetime.

Changes:

  • Commented out the line that registers child metrics with the parent, preventing memory accumulation
  • Added a TODO comment with a link to the upstream tracking issue

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

@sgrebnov sgrebnov merged commit f258e7b into spiceai Jan 14, 2026
13 of 35 checks passed
@sgrebnov sgrebnov deleted the sgrebnov/0113-mem-test branch January 14, 2026 07:25
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants