High Memory Usage and Long GC Times When Writing Parquet Files
まだ誰も着手していません。
評価
- 難易度
- 5/5
- 見積もり時間
- 1週間以上
- 初心者へのやさしさ
- 25/100
- issue の種類
- バグ
- 明瞭さ
- 説明が足りない
- 活発さ
- 停滞
- 技術スタック
- java
調査の方向性
エントリポイントの ExampleParquetWriter.builder から開始し、報告されている InternalParquetRecordWriter → ColumnWriterV1 → FallbackValuesWriter → PlainDoubleDictionaryValuesWriter → IntList のチェーンを追跡します。既存の行数および row group の設定を、並行書き込みのシナリオと比較します。Done では、メモリと GC のオーバーヘッドを削減するためのサポートされている方法を特定するか、スキーマ関連のオブジェクトをスレッド間で共有できない理由を明確に文書化する必要があります。
索引モデルが issue の本文から書いたものです。
説明
Describe the usage question you have. Please include as many useful details as possible.
In my project, I am using the following code to write Parquet files to the server:
ParquetWriter parquetWriter = ExampleParquetWriter.builder(new Path(filePath))
.withConf(new Configuration())
.withType(messageType)
.build();
Each Parquet file contains 30000 columns. This code is executed by multiple threads simultaneously, which results in increased GC time. Upon analyzing memory usage, I found that the main memory consumers are related to the following chain:
InternalParquetRecordWriter -> ColumnWriterV1 -> FallbackValuesWriter -> PlainDoubleDictionaryValuesWriter -> IntList
Each thread writes to a file with the same table schema (header), differing only in the filePath.
I initially suspected that the memory usage was caused by the file buffer not being flushed in time. To address this, I tried configuring the writer with the following parameters:
parquetWriter = ExampleParquetWriter.builder(new Path(filePath))
.withConf(new Configuration())
.withType(messageType)
.withMinRowCountForPageSizeCheck(SpringContextUtils.getApplicationContext()
.getBean(EtlTaskProperties.class).getMinRowCountForPageSizeCheck())
.withMaxRowCountForPageSizeCheck(SpringContextUtils.getApplicationContext()
.getBean(EtlTaskProperties.class).getMaxRowCountForPageSizeCheck())
.withRowGroupSize(SpringContextUtils.getApplicationContext()
.getBean(EtlTaskProperties.class).getRowGroupSize())
.build();
However, these adjustments did not solve the issue. The program still experiences long GC pauses and excessive memory usage.
Expected Behavior
Efficient Parquet file writing with reduced GC time and optimized memory usage when multiple threads are writing files simultaneously.
Observed Behavior
• Increased GC time and excessive memory usage.
• Memory analysis indicates IntList under PlainDoubleDictionaryValuesWriter is the primary consumer of memory.
Request
What are the recommended strategies to mitigate excessive memory usage in this scenario?
Is there a way to share table schema-related objects across threads, or other optimizations to reduce memory overhead?
Please let me know if additional information is needed!
No response
- 主要言語
- Java
- スター
- 3.1k
- フォーク
- 1.6k
- 平均マージ
- 6日 16時間
- マージ済み PR(30日)
- 36
コントリビューションガイド
このリポジトリのコントリビューションガイドは索引されていません
はじめの一歩
- issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
- 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
- リポジトリをフォークし、ブランチを切って変更します。
- issue 番号を参照したプルリクエストを送ります。
apache/parquet-java のほかの issue
-
Type: bug
難易度 2/5 1〜3時間 初心者へのやさしさ 68/100
apache/parquet-java#3792 ·
-
難易度 2/5 1〜3時間 初心者へのやさしさ 82/100
apache/parquet-java#3767 ·
-
難易度 2/5 1〜3時間 初心者へのやさしさ 72/100
apache/parquet-java#3695 · コメント 1 件 ·
-
難易度 2/5 1〜3時間 初心者へのやさしさ 78/100
apache/parquet-java#3667 ·
-
Type: bug
難易度 2/5 1〜3時間 初心者へのやさしさ 76/100
apache/parquet-java#3587 ·
apache/parquet-java の issue をすべて見る
似ている issue
-
documentation
難易度 2/5 1〜3時間 初心者へのやさしさ 65/100
inu-appcenter/memorIN-backend#288 ·
-
難易度 2/5 1〜3時間 初心者へのやさしさ 65/100
-
frontend maui-pilot pilot-ask question
難易度 2/5 1〜3時間 初心者へのやさしさ 75/100
-
難易度 2/5 1〜3時間 初心者へのやさしさ 75/100
-
area/plugin
難易度 2/5 1〜3時間 初心者へのやさしさ 75/100
kestra-io/plugin-kestra#190 ·