Skip to content

memory: cap Bitbucket bodies, serialize mentions and rollups, warm tokenizer - #206

Merged
trick77 merged 3 commits into
masterfrom
worktree-oom-peak-memory
Sep 16, 2026
Merged

trick77 merged 3 commits into
masterfrom
worktree-oom-peak-memory

Conversation

@trick77

@trick77 trick77 commented Sep 16, 2026

Copy link
Copy Markdown
Owner

Pod OOMKilled at 256Mi on the first real review: idle RSS 105Mi, the
tiktoken encoder alone is 110Mi and loaded lazily, leaving ~40Mi for
diff, file bodies and the rendered prompt.

  • Bitbucket diff/file GETs stream with byte caps (BITBUCKET_MAX_DIFF_BYTES
    10Mi, BITBUCKET_MAX_FILE_BYTES 1Mi) and raise ContentTooLarge. An
    oversize diff posts a skip summary, an oversize file falls back to
    diff-only, a mention replies instead of failing.
  • Mentions and merge/decline rollups run on the ReviewQueue worker via
    submit_job instead of BackgroundTasks: one diff/prompt set resident.
  • _prepare_files fetches at most 4 bodies at once; the cumulative diff is
    dropped by byte length before tokenizing.
  • Tokenizer loaded in lifespan so idle RSS is the real baseline.
  • MALLOC_ARENA_MAX=2 in the Containerfile.

…kenizer

Pod OOMKilled at 256Mi on the first real review: idle RSS 105Mi, the
tiktoken encoder alone is 110Mi and loaded lazily, leaving ~40Mi for
diff, file bodies and the rendered prompt.

- Bitbucket diff/file GETs stream with byte caps (BITBUCKET_MAX_DIFF_BYTES
  10Mi, BITBUCKET_MAX_FILE_BYTES 1Mi) and raise ContentTooLarge. An
  oversize diff posts a skip summary, an oversize file falls back to
  diff-only, a mention replies instead of failing.
- Mentions and merge/decline rollups run on the ReviewQueue worker via
  submit_job instead of BackgroundTasks: one diff/prompt set resident.
- _prepare_files fetches at most 4 bodies at once; the cumulative diff is
  dropped by byte length before tokenizing.
- Tokenizer loaded in lifespan so idle RSS is the real baseline.
- MALLOC_ARENA_MAX=2 in the Containerfile.
@trick77
trick77 merged commit e5cb348 into master Sep 16, 2026
2 checks passed
@trick77
trick77 deleted the worktree-oom-peak-memory branch September 16, 2026 14:26
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.

1 participant