Bound PGBKCVOperation precombine table by in-memory size (#39754) - #39767
Open
Dharshika-11 wants to merge 1 commit into
Open
Bound PGBKCVOperation precombine table by in-memory size (#39754)#39767Dharshika-11 wants to merge 1 commit into
Dharshika-11 wants to merge 1 commit into
Conversation
Contributor
|
Checks are failing. Will not request review until checks are succeeding. If you'd like to override that behavior, comment |
Dharshika-11
force-pushed
the
fix-pgbkcv-memory-bounding
branch
from
August 17, 2026 05:58
61b65ca to
9b7a27a
Compare
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.
Summary
This PR updates PGBKCVOperation to bound its precombine table based on estimated in-memory size in addition to the existing key-count limit.
Changes
Added an in-memory size limit using max_bytes.
PGBKCVOperation now tracks estimated memory usage through estimated_bytes and get_deep_size.
Added default memory limits:
10 MB for general accumulators.
100 MB for tiny accumulators such as Count, Mean, sum, min, and max.
The table now flushes when the estimated memory usage exceeds the configured limit, helping prevent OOM situations caused by very large accumulators.
Updated operations.pxd with the new Cython declarations:
max_bytes
estimated_bytes
_is_tiny_accumulator
Added unit tests covering:
Memory-limit-based flushing.
Existing key-count-based flushing.
Custom max_bytes and max_keys parameters.
Correct output after flushing.
Issue
Fixes #39754