Repository navigation
fix(pipeline): bound cross-file preparation memory - #2909
chang-chaunce wants to merge 1 commit into
Conversation
Size C# and JVM scratch arrays by matching definitions. Refuse global cross-file allocations over the remaining budget and propagate budget aborts without replacing the serving index. Add self-contained allocation and publication-preservation regressions. Signed-off-by: chaunce <chang.chaunce@gmail.com>
|
Thanks for opening this — it has been seen, and it is queued. This note is automated, but it is not a brush-off: it exists so you know where your PR stands instead of having to guess from silence. Current review status: working through a backlog. What that means for this PR, concretely:
Things that will genuinely speed it up whenever review does happen:
If this fixes a bug, a reproduction we can run is worth more than a description of the symptom. Thanks for contributing, and sorry in advance for the wait. |
|
Hi @chang-chaunce, thank you for this careful PR. The reproduce-first control, the arena-capacity test instead of an RSS guess, and the byte-for-byte check that the serving database survives a refusal are exactly how we like memory work to arrive. We measured it before deciding: the Linux kernel, Elasticsearch, and Exposed with a generated 3-million-key JSON archive. The graph is byte-identical to main on all of them, and your new tests fail without the fix for the right reasons. One part we would like to change:
If you would rather we make these edits on your branch, just say so; maintainer edits are enabled and we are happy to. Thanks again! |
What does this PR do?
Cross-file LSP preparation can allocate far beyond the worker's memory budget after extraction has already spilled its results. In an observed macOS arm64 run on 0.12.1, charged footprint reached 19,169 MiB against a 7,090 MiB budget during this phase.
Two allocations contribute to this: C# and JVM partition scratch arrays use the definition count of the entire project, including unrelated JSON definitions, and the global definition collector allocates its array and copied strings without a budget refusal path.
This change:
Related context: #1997 and #2711. No configuration defaults, MCP tool APIs, dependencies or build-system changes.
Validation
scripts/test.sh --suites 'mem pipeline cs_lsp java_lsp': 689 passed, ASan + UBSan, macOS arm64; build parallelism capped at two.git diff --checkpass.scripts/lint.sh --ciwas attempted with local cppcheck 2.22.0 (CI pins 2.20.0). It reports existing findings in unchanged code. In the two touched pipeline files, a separate check of the unmodified base reproduces the same four control-flow findings as the patched files; no additional finding remains. The pinned 2.20.0/full default test leg has not been run locally.The memory checks are cooperative and do not replace the optional process-tree watchdog. The original large private corpus was not rerun; the committed regressions are self-contained and need no private data.
Checklist
AI-assisted contribution: prepared with OpenAI Codex on behalf of @chang-chaunce.