Parquet import of wide-string files (websight-v01) runs out of heap at -Xmx8g

未關閉
#657 0 則留言 0 個 reaction 已指派 0 人 在 GitHub 檢視

維護者通常 1 天內回覆

還沒有人認領這個 Issue。

評估

難度
4/5
預估耗時
3-5 天
新手友好度
35/100
Issue 類型
缺陷
描述清晰度
基本清楚
活躍度
活躍
技術堆疊
java

研究方向

Start from ParquetImporter and ImportOptions#withChunkSize to see how rows are batched before they reach hardwood, then read the stack trace's PageDecoder.parseDataPage and ColumnWorker.decode in hardwood. Reproducing needs the 29 GB websight-v01 file, so first measure the heap at a smaller chunk size. Done means a bounded-heap import succeeds at a stated -Xmx, with the chunk-size or CLI option documented.

由索引模型根據 Issue 內容生成。

描述

bug

vortex import of Raincloud's websight-v01 (29 GB Parquet, 822,987 rows, ~35 KB of HTML per row) runs out of heap with -Xmx8g, 15% of the way through:

java -Xmx8g --enable-native-access=ALL-UNNAMED -jar vortex-cli-0.19.1-SNAPSHOT-all.jar import websight-v01.parquet out.vortex
  [====>   ]  15%  131,072 / 822,987 rows
Exception in thread "main" java.lang.OutOfMemoryError: Java heap space
	at java.util.Arrays.copyOfRange(Arrays.java:3849)
	at dev.hardwood.internal.encoding.PlainDecoder.readByteArray(PlainDecoder.java:285)
	at dev.hardwood.internal.encoding.PlainDecoder.readByteArrays(PlainDecoder.java:217)
	at dev.hardwood.internal.reader.PageDecoder.decodeTypedValues(PageDecoder.java:485)
	at dev.hardwood.internal.reader.PageDecoder.parseDataPage(PageDecoder.java:335)
	at dev.hardwood.internal.reader.ColumnWorker.decode(ColumnWorker.java:508)

The same import with -Xmx48g succeeds (822,987 rows, 77 s, 30.9 GB output), so this is a memory-footprint problem, not a correctness one. The failure is in hardwood's page decode (one byte[] per value, held for the whole page), reached through ParquetImporter.

Unknown, to measure:

  • how much of the heap is hardwood's decoded pages vs the importer's own chunk buffers (default ImportOptions chunk size is 65,536 rows, which is ~2.3 GB of strings for this file before encoding);
  • the smallest -Xmx that works, and whether a smaller chunk size (ImportOptions#withChunkSize) lowers it. The CLI has no flag for the chunk size today.
  • whether hardwood decodes columns in parallel and so multiplies the footprint (the file has three columns: image struct of binary + path, text, split).

Hits any wide-string Parquet: found while rerunning the #643 slugs (websight-v01, open-food-facts; the latter imported fine with -Xmx48g). Not an -Xmx default problem on a large machine (the default heap is a quarter of RAM), but a laptop with 16 GB would hit it.

Possible directions: size the chunk by bytes as well as rows, so a 35 KB-per-row file uses fewer rows per chunk; expose the chunk size on the CLI; document the heap a large import needs.

主要語言
Java
星號
3
分支
2
平均合併
9 小時 51 分鐘
30 天內合併 PR
127

環境準備

  • 沒有 Dockerfile 或 Docker Compose 檔案
  • 沒有 Pull Request 範本
  • 閱讀貢獻指南

從這裡開始

  1. 先讀完整個 Issue,再讀專案的貢獻指南。
  2. 在 Issue 下留言說明你要接手 —— 這能避免兩個人做同樣的事。
  3. Fork 儲存庫,在一個分支上完成修改。
  4. 送出 Pull Request,並在描述裡引用這個 Issue 編號。

dfa1/vortex-java 的其他 Issue

查看 dfa1/vortex-java 的全部 Issue

相似的 Issue

更多 Java Issue

把新 issue 寄到你的電子郵件信箱

精選適合新手參與的 GitHub issue 摘要。