Hacktoberfest 2026: những issue maintainer đã đánh dấu cho tháng Mười, đang mở và phù hợp người mới. Xem issue Hacktoberfest

index_repository 导致 oom

Đang mở
#2,649 3 bình luận 0 reaction 0 người được giao Xem trên GitHub

Maintainer thường phản hồi trong vòng 2 ngày

Chưa có ai nhận issue này.

Đánh giá

Độ khó
4/5
Thời gian dự kiến
3-5 ngày
Mức phù hợp với người mới
15/100
Loại issue
Lỗi
Độ rõ ràng
Khá rõ ràng
Mức độ hoạt động
Sôi nổi
Công nghệ
c
Lĩnh vực
devtools

Hướng nghiên cứu

The crash is in the index_repository tool with mode: fast on a large repo, and the logs point at the indexing worker pool and the memory budget (about 971 MB with 16 workers), which the reporter says was exceeded. The repository is not shareable, so first reproduce on a public C/C++ repo of similar size and watch peak RSS. Done means the budget is respected or the memory growth is explained, with .cbmignore exclusions tested as a workaround.

Do mô hình lập chỉ mục viết ra từ nội dung của issue.

Mô tả

bug editor/integration stability/performance
Version

codebase-memory-mcp 0.10.8

Platform

Linux (x64)

Install channel

GitHub release archive / install.sh / install.ps1

Binary variant

standard

What happened, and what did you expect?

在ubuntu 22.04,16g内存的pc上,使用codex,在一个新的代码仓库下,帮我快速了解一下这个项目,然后codex使用这个工具,配置为
mcp__codebase_memory.index_repository({
"repo_path": "/home/jenkins/code/Middleware",
"mode": "fast",
"name": "home-jenkins-code-Middleware"
})
然后会引起pc死机(必须强制关机),重试多次,都是如此,dmesg显示
[ 272.000873] oom-kill:constraint=CONSTRAINT_NONE,nodemask=(null),cpuset=user.slice,mems_allowed=0,global_oom,task_memcg=/user.slice/user-1000.slice/session-2.scope,task=codebase-memory,pid=9329,uid=1000
[ 272.000924] Out of memory: Killed process 9329 (codebase-memory) total-vm:25597872kB, anon-rss:12487496kB, file-rss:0kB, shmem-rss:0kB, UID:1000 pgtables:44476kB oom_score_adj:0

随后,让codex自己分析:
"""
确认了,这是我刚才触发的代码索引任务被 OOM 杀掉,不是测试框架运行导致的。抱歉,这次“快速了解”不该启动整个仓库的索引。

  • 进程完全对应:索引日志中的 PID 是 9329,与内核日志一致。
  • 实际内存占用约 11.9 GiB:anon-rss:12487496kB;total-vm 约 24.4 GiB 是虚拟地址空间,不等于实际物理内存占用。
  • 触发全局 OOM:日志明确为 global_oom,不是命中某个容器的内存上限。
  • 索引范围过大:实际扫描了 15,543 个文件,结束前正在处理大量 Boost 头文件;仓库的第三方依赖目录就有 15,218 个受版本管理的文件。
  • 预算未控制住实际占用:索引日志记录约 971 MB 的内存预算、16 个并行 worker,但占用仍远超预算;具体分配原因尚未定位。

我没有重跑索引,也没有修改仓库。后续会直接按需阅读源码;若要继续使用索引,应先通过 .cbmignore 排除第三方依赖,再单独验证内存占用。
Worked for 1m 37s • 4:29 PM

你是哪个命令引起的OOM

是我调用的这个全仓库代码索引工具引起的:

mcp__codebase_memory.index_repository({
"repo_path": "/home/jenkins/code/Middleware",
"mode": "fast",
"name": "home-jenkins-code-Middleware"
})

这是 MCP 工具调用,不是我在终端执行的 shell 命令。它启动的 codebase-memory 进程 PID 为 9329,与 OOM 日志完全一致
"""

不太清楚此现象是否是正常的,这只是一个中等小型代码仓库。按我的理解,它不应该让我的pc死机

Reproduction

codebase-memory-mcp 0.10.8

mcp__codebase_memory.index_repository({
"repo_path": "/home/jenkins/code/Middleware",
"mode": "fast",
"name": "home-jenkins-code-Middleware"
})
对项目代码初始化阶段就会出现上述问题
抱歉,我不能把我的本地代码提供给你们

Logs

Diagnostics trajectory (memory / performance / leak issues)

Project scale (if relevant)

No response

Confirmations
  • I searched existing issues and this is not a duplicate.
  • My reproduction uses shareable code (a dummy snippet or a public OSS repository), not proprietary code.
Ngôn ngữ chính
C
Star
45.8k
Fork
3.8k
Merge trung bình
3 ngày 6 giờ
Pull request đã merge (30 ngày)
201

Chuẩn bị môi trường

Dự án này không cung cấp dev container, Dockerfile hay hướng dẫn đóng góp, nên bạn cần tự thiết lập môi trường: hãy bắt đầu từ README và xem hướng dẫn đóng góp lần đầu của chúng tôi để biết các bước chung.

Bắt đầu từ đâu

  1. Đọc hết issue, rồi đọc hướng dẫn đóng góp của dự án.
  2. Bình luận trên issue rằng bạn sẽ nhận — tránh hai người làm cùng một việc.
  3. Fork repository và làm thay đổi trên một nhánh.
  4. Mở pull request có tham chiếu số hiệu của issue.

Issue khác của DeusData/codebase-memory-mcp

Tất cả issue của DeusData/codebase-memory-mcp

Issue tương tự

Thêm issue về C

Nhận issue mới trong hộp thư của bạn

Bản tóm tắt ngắn những issue GitHub phù hợp với người mới.