Skip to content

PL function has memory leak issue in long running SQL#880

Open
hnwyllmm wants to merge 1 commit into
masterfrom
issue/2026042900115822534
Open

PL function has memory leak issue in long running SQL#880
hnwyllmm wants to merge 1 commit into
masterfrom
issue/2026042900115822534

Conversation

@hnwyllmm

Copy link
Copy Markdown
Member

Task Description

In long-running SQL statements, frequent calls to PL functions pose a risk of memory leaks.

Solution Description

Previously, each call to a PL function could allocate a block of memory using the executor context's allocator, which is an arena allocator. This memory would only be freed upon completion of the SQL execution. For SQL statements running continuously for several hours, the memory allocated by PL functions could become significant.

The fix changes the memory allocation to use a temporary allocator local to the PL function. Memory allocated by this temporary allocator is released immediately upon completion of the PL function's execution.

Passed Regressions

Upgrade Compatibility

Other Information

Related internal issue: DIMA-2026042900115822534

Release Note

@hnwyllmm

Copy link
Copy Markdown
Member Author

The mapping Dima issue is [seekdb][ddlmigrate]mod=SqlPx module suspected memory leak

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