-
Notifications
You must be signed in to change notification settings - Fork 407
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
fix: dramatically reduce checkpoint memory consumption #2956
Conversation
…oint For excessively large tables which do not have sufficient checkpoints or excessive `action` volume between checkpoints, the checkpoint code can consume an unreasonable amount of memory. In the case evaluated there were over a thousand transactions between transactions, but that resulted in over 2M actions which needed to be persisted to the checkpoint. This scenario led to 19.9GB of memory utilized when producing checkpoints for a table which used 3.8GB to open. By iteratively processing the buffers which need to be serialized, the memory is dramatically reduced: **Before**: Maximum resident set size (kbytes): 19964728 **After:** Maximum resident set size (kbytes): 4621648 Sponsored-by: Scribd Inc Signed-off-by: R. Tyler Croy <rtyler@brokenco.de>
Similar to the prior commit, this improves the iterative nature of checkpoint creation. **Before:** Maximum resident set size (kbytes): 4621648 **After:** Maximum resident set size (kbytes): 4017132 Sponsored-by: Scribd Inc Signed-off-by: R. Tyler Croy <rtyler@brokenco.de>
Codecov ReportAttention: Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #2956 +/- ##
==========================================
- Coverage 72.38% 72.35% -0.03%
==========================================
Files 131 131
Lines 40599 40602 +3
Branches 40599 40602 +3
==========================================
- Hits 29387 29378 -9
- Misses 9335 9336 +1
- Partials 1877 1888 +11 ☔ View full report in Codecov by Sentry. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nice catch!
Both commits describe the specific fixes, but basically our checkpoint code was collecting too much into memory when it could iterate! :roller_coaster: With a test table: Before `Maximum resident set size (kbytes): 19964728` After `Maximum resident set size (kbytes): 4017132` Sponsored-by: [Scribd Inc](https://tech.scribd.com) --------- Signed-off-by: R. Tyler Croy <rtyler@brokenco.de> (cherry picked from commit c05931a)
Both commits describe the specific fixes, but basically our checkpoint code was collecting too much into memory when it could iterate! 🎢
With a test table:
Before
Maximum resident set size (kbytes): 19964728
After
Maximum resident set size (kbytes): 4017132
Sponsored-by: Scribd Inc