High Memory Usage and Long GC Times When Writing Parquet Files
Personne n'a encore pris cette issue.
Évaluation
- Difficulté
- 5/5
- Temps estimé
- Plus d'une semaine
- Accessibilité débutants
- 25/100
- Type d'issue
- Bug
- Clarté
- À clarifier
- Activité
- À l'abandon
- Stack technique
- java
- Domaine
- data-engineering
Piste de recherche
Commencez au point d’entrée ExampleParquetWriter.builder et suivez la chaîne signalée InternalParquetRecordWriter → ColumnWriterV1 → FallbackValuesWriter → PlainDoubleDictionaryValuesWriter → IntList. Comparez les paramètres existants du nombre de lignes et des row groups avec le scénario d’écriture concurrente. Done doit identifier une méthode prise en charge pour réduire la surcharge de mémoire et de GC, ou documenter clairement pourquoi les objets liés au schéma ne peuvent pas être partagés entre les threads.
Rédigé par le modèle d'indexation à partir du texte de l'issue.
Description
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
- Langage dominant
- Java
- Étoiles
- 3.1k
- Forks
- 1.6k
- Merge moyen
- 6 j 16 h
- PR mergées (30 j)
- 36
Guide de contribution
Aucun guide de contribution indexé pour ce dépôt
Par où commencer
- Lisez l'issue en entier, puis le guide de contribution du projet.
- Signalez en commentaire que vous la prenez — cela évite que deux personnes fassent le même travail.
- Forkez le dépôt et travaillez sur une branche.
- Ouvrez une pull request qui référence le numéro de l'issue.
Autres issues de apache/parquet-java
-
Type: bug
Difficulté 2/5 1-3 heures Accessibilité débutants 68/100
apache/parquet-java#3792 ·
-
Make PageReader AutoCloseable Ouverte
Difficulté 2/5 1-3 heures Accessibilité débutants 82/100
apache/parquet-java#3767 ·
-
Difficulté 2/5 1-3 heures Accessibilité débutants 72/100
apache/parquet-java#3695 · 1 commentaire ·
-
Difficulté 2/5 1-3 heures Accessibilité débutants 78/100
apache/parquet-java#3667 ·
-
Type: bug
Difficulté 2/5 1-3 heures Accessibilité débutants 76/100
apache/parquet-java#3587 ·
Toutes les issues de apache/parquet-java
Issues similaires
-
documentation
Difficulté 2/5 1-3 heures Accessibilité débutants 65/100
inu-appcenter/memorIN-backend#288 ·
-
Difficulté 2/5 1-3 heures Accessibilité débutants 65/100
-
frontend maui-pilot pilot-ask question
Difficulté 2/5 1-3 heures Accessibilité débutants 75/100
-
Difficulté 2/5 1-3 heures Accessibilité débutants 75/100
-
executions.Query — startDate and timeRange filters are sent with inverted comparison operators Ouvertearea/plugin
Difficulté 2/5 1-3 heures Accessibilité débutants 75/100
kestra-io/plugin-kestra#190 ·