[PR #109] [MERGED] fix memory leak in create #41242

Closed
opened 2026-04-24 21:09:36 -05:00 by GiteaMirror · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/ollama/ollama/pull/109
Author: @mxyng
Created: 7/19/2023
Status: Merged
Merged: 7/19/2023
Merged by: @mxyng

Base: mainHead: fix-create-memory


📝 Commits (1)

  • 553fa39 fix memory leak in create

📊 Changes

1 file changed (+27 additions, -30 deletions)

View changed files

📝 server/images.go (+27 -30)

📄 Description

do not buffer the model into memory. instead use io.Copy to pass the contents directly to the destination writer, whether that is the hasher or file writer

this also significantly improve the hashing performance


🔄 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/109 **Author:** [@mxyng](https://github.com/mxyng) **Created:** 7/19/2023 **Status:** ✅ Merged **Merged:** 7/19/2023 **Merged by:** [@mxyng](https://github.com/mxyng) **Base:** `main` ← **Head:** `fix-create-memory` --- ### 📝 Commits (1) - [`553fa39`](https://github.com/ollama/ollama/commit/553fa39fe86ac7a3c69a391cfc97829f7e72dc77) fix memory leak in create ### 📊 Changes **1 file changed** (+27 additions, -30 deletions) <details> <summary>View changed files</summary> 📝 `server/images.go` (+27 -30) </details> ### 📄 Description do not buffer the model into memory. instead use `io.Copy` to pass the contents directly to the destination writer, whether that is the hasher or file writer this also significantly improve the hashing performance --- <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-24 21:09:36 -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#41242