memory: cap Bitbucket bodies, serialize mentions and rollups, warm tokenizer - #206
Merged
Merged
Conversation
…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.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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.
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.
submit_job instead of BackgroundTasks: one diff/prompt set resident.
dropped by byte length before tokenizing.