Skip to content

Conversation

@Schwarf
Copy link
Contributor

@Schwarf Schwarf commented Jan 3, 2026

Fixes #224
Fixes the memory leak reported in #224

The issue was caused by Python UDF return values not being released after conversion. While this affected all return types, it was only observable for large VARCHAR/bytes values due to their size. The fix ensures correct reference management using py::reinterpret_steal<py::object>.

A regression test was added to detect refcount leaks in Python scalar UDF execution.

@evertlammerts evertlammerts added this pull request to the merge queue Jan 6, 2026
@evertlammerts evertlammerts removed this pull request from the merge queue due to a manual request Jan 6, 2026
@evertlammerts evertlammerts added this pull request to the merge queue Jan 6, 2026
@evertlammerts evertlammerts removed this pull request from the merge queue due to the queue being cleared Jan 6, 2026
@evertlammerts evertlammerts merged commit 77e4b02 into duckdb:main Jan 6, 2026
15 checks passed
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.

UDF Memory Leak

2 participants