apache / apache/parquet-java

Provide option to use on-heap buffers for Snappy compression/decompression

Offen
#1,408 9 Kommentare 0 Reaktionen 0 zugewiesene Personen Auf GitHub ansehen
Component: Java Component: Parquet Priority: Major Type: enhancement
Vorherrschende Sprache
Java
Sterne
3.1k
Forks
1.6k
Ø Merge
3 T. 12 Std.
Gemergte PRs (30 T.)
33

Beschreibung

The current code uses direct off-heap buffers for decompression. If many decompressors are instantiated across multiple threads, and/or the objects being decompressed are large, this can lead to a huge amount of off-heap allocation by the JVM. This can be exacerbated if overall, there is not heap contention, since no GC will be performed to reclaim the space used by these buffers.

It would be nice if there was a flag we cold use to simply allocate on-heap buffers here:

https://github.com/apache/incubator-parquet-mr/blob/master/parquet-hadoop/src/main/java/parquet/hadoop/codec/SnappyDecompressor.java#L28

We ran into an issue today where these buffers totaled a very large amount of storage and caused our Java processes (running within containers) to be terminated by the kernel OOM-killer.

**Reporter**: [Patrick Wendell](https://issues.apache.org/jira/secure/ViewProfile.jspa?name=pwendell)
#### Related issues:
- [Parquet+Snappy can cause significant off-heap memory usage](https://issues.apache.org/jira/browse/SPARK-4073) (breaks)

**Note**: *This issue was originally created as [PARQUET-118](https://issues.apache.org/jira/browse/PARQUET-118). Please see the [migration documentation](https://issues.apache.org/jira/browse/PARQUET-2502) for further details.*

Beitragsleitfaden

Für dieses Repository ist kein Beitragsleitfaden indexiert

Rechercherichtung

Beginne mit parquet-hadoop/src/main/java/parquet/hadoop/codec/SnappyDecompressor.java und untersuche, wie Dekompressionspuffer derzeit allokiert werden. Lege fest, wie ein Flag On-Heap-Puffer auswählen soll, und überprüfe anschließend, dass die Snappy-Dekompression weiterhin funktioniert und dass der ausgewählte Modus das gemeldete Wachstum der Off-Heap-Allokation vermeidet.

Vom Indexierungsmodell aus dem Issue-Text verfasst.

Bewertung

Tech-Stack
java
Bereich
data-engineering
Issue-Typ
Feature
Schwierigkeit
3/5
Geschätzter Aufwand
1-2 Tage
Aktivitätsstatus
Veraltet
Klarheit
Größtenteils klar
Anfängerfreundlichkeit
35/100

Neue Issues direkt in Ihr Postfach

Eine kurze Übersicht über anfängerfreundliche GitHub-Issues.