Skip to content

[vortex] Free the intermediate native expressions built for a scan - #9841

Open
jackylee-ch wants to merge 1 commit into
apache:masterfrom
jackylee-ch:vortex-expression-lifetime
Open

jackylee-ch wants to merge 1 commit into
apache:masterfrom
jackylee-ch:vortex-expression-lifetime

Conversation

@jackylee-ch

Copy link
Copy Markdown
Contributor

Purpose

The fork swapped upstream's Cleaner for an explicit close() (paimon-vortex-jni/README.md), so two expressions now leak unreachable: column(name) drops the root() it passes to getItem, and VortexRecordsReader:95 drops the inline root() plus its projection.

Both are safe to release: vortex-jni builders do not take ownership (expression.rs module doc @ 0.73.0) and scan.rs:82-92 clones the projection, so both are dead once dataSource.scan returns. ~96 bytes per predicate leaf: over 500k column() calls RSS grew 52896 KB before, 5984 KB after.

Tests

No regression test is possible — native allocation has no Java-visible counter. The 72 tests in paimon-vortex-format prove placement: every predicate leaf and read goes through both changed paths. The converter's operands and the pushed filter still leak; that needs a lifetime contract.

Written with Claude Code; verification is mine.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant