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 摘要。