Skip to content

Comments

fix(common): log correct peak memory usage#1792

Merged
leoyvens merged 1 commit intomainfrom
leo/issue-1789
Feb 17, 2026
Merged

fix(common): log correct peak memory usage#1792
leoyvens merged 1 commit intomainfrom
leo/issue-1789

Conversation

@leoyvens
Copy link
Collaborator

Resolves #1789.

The execute_plan method returns a lazy stream, so logging peak memory immediately after execution captured always 0. Wrap the stream in PeakMemoryStream to log when the stream is actually consumed or cancelled.

Tested manually.

@leoyvens leoyvens requested a review from Theodus February 17, 2026 19:50
The execute_plan method returns a lazy stream, so logging peak memory immediately
after execution captured incorrect values. Wrap the stream in PeakMemoryStream
to log when the stream is actually consumed or cancelled.

- Add PeakMemoryStream wrapper implementing Stream and RecordBatchStream
- Move peak memory debug log from execute_plan to PeakMemoryStream::drop
- Import Stream, Pin, Context, Poll, SchemaRef, and RecordBatchStream

Signed-off-by: Leonardo Yvens <leoyvens@gmail.com>
Copy link
Member

@Theodus Theodus left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@leoyvens leoyvens merged commit fcfe7af into main Feb 17, 2026
7 checks passed
@leoyvens leoyvens deleted the leo/issue-1789 branch February 17, 2026 20:01
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.

Peak memory usage always reported as 0

2 participants