Skip to content

Fix memory leaks - #2153

Merged
kunal-vaishnavi merged 3 commits into
mainfrom
skottmckay/FixMemoryLeak
May 18, 2026
Merged

Fix memory leaks#2153
kunal-vaishnavi merged 3 commits into
mainfrom
skottmckay/FixMemoryLeak

Conversation

@skottmckay

Copy link
Copy Markdown
Contributor

Memory leak showed up in FL testing.

Copilot AI review requested due to automatic review settings May 11, 2026 07:54
@skottmckay
skottmckay requested a review from a team as a code owner May 11, 2026 07:54

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Pull request overview

This PR addresses a memory leak in the C++ zero-overhead wrapper (src/ort_genai.h) by ensuring temporary OgaStringArray allocations created for batch prompt processing are released.

Changes:

  • Added OgaDestroyStringArray(strs) after batch multi-modal processing calls for images, audios, and images+audios prompt APIs.
  • Prevented OgaStringArray from leaking on the success path of these helper functions.

Comment thread src/ort_genai.h Outdated
Comment thread src/ort_genai.h Outdated
Comment thread src/ort_genai.h Outdated
@baijumeswani
baijumeswani force-pushed the skottmckay/FixMemoryLeak branch from 898d26e to bffe6f0 Compare May 15, 2026 20:52

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Pull request overview

Copilot reviewed 1 out of 1 changed files in this pull request and generated no new comments.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
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.

4 participants