You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@parquet.apache.org by "iemejia (via GitHub)" <gi...@apache.org> on 2026/05/01 22:20:28 UTC

[PR] GH-3522: Reduce peak memory during row group flush by eagerly releasing column buffers [parquet-java]

iemejia opened a new pull request, #3537:
URL: https://github.com/apache/parquet-java/pull/3537

   ## Summary
   
   - Add `writeAllToAndRelease()` to `ConcatenatingByteBufferCollector` for progressive slab-by-slab memory release during write
   - Make `close()` idempotent (safe to call after eager release or multiple times)
   - Call `pageWriter.close()` after each column in `flushToFileWriter()` to release buffers immediately
   
   ## Rationale
   
   During `flushToFileWriter()`, each column's compressed page buffers were held in memory until the entire row group flush completed. For a schema with N columns, peak flush memory was ~N columns' worth of compressed pages.
   
   With this change, each column's buffers are released immediately after being written to disk, reducing peak flush memory from ~N columns' worth to ~1 column's worth. For wide schemas (20+ columns) with large row groups, this can reduce peak memory by an order of magnitude during the flush phase.
   
   ## Tests
   
   - `TestConcatenatingByteBufferCollector`: tests for eager release, double-close safety, and output equivalence
   - All existing tests pass


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: issues-unsubscribe@parquet.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@parquet.apache.org
For additional commands, e-mail: issues-help@parquet.apache.org


Re: [PR] GH-3522: Reduce peak memory during row group flush by eagerly releasing column buffers [parquet-java]

Posted by "iemejia (via GitHub)" <gi...@apache.org>.
iemejia commented on PR #3537:
URL: https://github.com/apache/parquet-java/pull/3537#issuecomment-4472736304

   Closing in favor of #3571.
   
   I initially submitted a series of small, focused PRs thinking they'd be easier to review. In practice the sheer number (~16 PRs, with more pending) made things harder to follow — even for me. I've regrouped the changes by encoding type / performance area so that each PR is self-contained with its own benchmarks and test coverage, which should make review and performance analysis much more straightforward.
   
   Apologies for the churn. If you've been reviewing this PR, please continue the discussion on #3571 which supersedes it. Thank you.


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: issues-unsubscribe@parquet.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@parquet.apache.org
For additional commands, e-mail: issues-help@parquet.apache.org


Re: [PR] GH-3522: Reduce peak memory during row group flush by eagerly releasing column buffers [parquet-java]

Posted by "iemejia (via GitHub)" <gi...@apache.org>.
iemejia closed pull request #3537: GH-3522: Reduce peak memory during row group flush by eagerly releasing column buffers
URL: https://github.com/apache/parquet-java/pull/3537


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: issues-unsubscribe@parquet.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@parquet.apache.org
For additional commands, e-mail: issues-help@parquet.apache.org