[PR #10523] [MERGED] ollamarunner: Fix memory leak when processing images #59962

Closed
opened 2026-04-29 14:53:15 -05:00 by GiteaMirror · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/ollama/ollama/pull/10523
Author: @jessegross
Created: 5/1/2025
Status: Merged
Merged: 5/1/2025
Merged by: @jessegross

Base: mainHead: jessegross/mem_leak


📝 Commits (1)

  • 301960c ollamarunner: Fix memory leak when processing images

📊 Changes

1 file changed (+7 additions, -15 deletions)

View changed files

📝 runner/ollamarunner/runner.go (+7 -15)

📄 Description

The context (and therefore associated input tensors) was not being properly closed when images were being processed. We were trying to close them but in reality we were closing over an empty list, preventing anything from actually being freed.

Fixes #10434


🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.

## 📋 Pull Request Information **Original PR:** https://github.com/ollama/ollama/pull/10523 **Author:** [@jessegross](https://github.com/jessegross) **Created:** 5/1/2025 **Status:** ✅ Merged **Merged:** 5/1/2025 **Merged by:** [@jessegross](https://github.com/jessegross) **Base:** `main` ← **Head:** `jessegross/mem_leak` --- ### 📝 Commits (1) - [`301960c`](https://github.com/ollama/ollama/commit/301960cc95dc7aa702c39e902add23a285d47794) ollamarunner: Fix memory leak when processing images ### 📊 Changes **1 file changed** (+7 additions, -15 deletions) <details> <summary>View changed files</summary> 📝 `runner/ollamarunner/runner.go` (+7 -15) </details> ### 📄 Description The context (and therefore associated input tensors) was not being properly closed when images were being processed. We were trying to close them but in reality we were closing over an empty list, preventing anything from actually being freed. Fixes #10434 --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
GiteaMirror added the pull-request label 2026-04-29 14:53:15 -05:00
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: github-starred/ollama#59962