Ollama container does not clean memory usage #271

Closed
opened 2025-11-11 14:14:41 -06:00 by GiteaMirror · 2 comments
Owner

Originally created by @tgsca on GitHub (Feb 6, 2024).

Bug Report

Description

Bug Summary:
I am starting both containers, ollama and ollama-webui, with docker compose. This works well but with each interaction it slows down. I analyzed the usage statistics of the containers and recognized that the ollama container does not clean its memory usage. So the memory getting blocked more and more with each interaction.
After restarting the container the memory is cleaned up.

Steps to Reproduce:

  • start the containers with the docker-compose.yaml
  • register/login
  • pull a model (use a larger one, like mixtral, to see the described effect better)
  • start some chat sessions
  • monitor the memory usage with Docker Dashboard or with "docker stats --all" or "docker stats ollama"

Expected Behavior:
After ollama responded to a question, the memory cleans up automatically.

Actual Behavior:
After ollama responded to a question, the memory keeps reserved/used.

Environment

  • Operating System: Host: macOS Sonoma 14.2.1 (MacBook Pro M1, ARM), Docker Container: Ubuntu 22.04.3 LTS
  • Browser (if applicable): Chrome 121.0.6167.85

Reproduction Details

Confirmation:

  • I have read and followed all the instructions provided in the README.md.
  • I have reviewed the troubleshooting.md document.
  • I have included the browser console logs.
  • I have included the Docker container logs.

Logs and Screenshots

Browser Console Logs:
[Include relevant browser console logs, if applicable]

Docker Container Logs:
[Include relevant Docker container logs, if applicable]

Screenshots (if applicable):
[Attach any relevant screenshots to help illustrate the issue]

Installation Method

docker compose (Docker version 25.0.2, build 29cf629)

Additional Information

[Include any additional details that may help in understanding and reproducing the issue. This could include specific configurations, error messages, or anything else relevant to the bug.]

Note

If the bug report is incomplete or does not follow the provided instructions, it may not be addressed. Please ensure that you have followed the steps outlined in the README.md and troubleshooting.md documents, and provide all necessary information for us to reproduce and address the issue. Thank you!

Originally created by @tgsca on GitHub (Feb 6, 2024). # Bug Report ## Description **Bug Summary:** I am starting both containers, ollama and ollama-webui, with docker compose. This works well but with each interaction it slows down. I analyzed the usage statistics of the containers and recognized that the ollama container does not clean its memory usage. So the memory getting blocked more and more with each interaction. After restarting the container the memory is cleaned up. **Steps to Reproduce:** * start the containers with the docker-compose.yaml * register/login * pull a model (use a larger one, like mixtral, to see the described effect better) * start some chat sessions * monitor the memory usage with Docker Dashboard or with "docker stats --all" or "docker stats ollama" **Expected Behavior:** After ollama responded to a question, the memory cleans up automatically. **Actual Behavior:** After ollama responded to a question, the memory keeps reserved/used. ## Environment - **Operating System:** Host: macOS Sonoma 14.2.1 (MacBook Pro M1, ARM), Docker Container: Ubuntu 22.04.3 LTS - **Browser (if applicable):** Chrome 121.0.6167.85 ## Reproduction Details **Confirmation:** - [x] I have read and followed all the instructions provided in the README.md. - [ ] I have reviewed the troubleshooting.md document. - [ ] I have included the browser console logs. - [ ] I have included the Docker container logs. ## Logs and Screenshots **Browser Console Logs:** [Include relevant browser console logs, if applicable] **Docker Container Logs:** [Include relevant Docker container logs, if applicable] **Screenshots (if applicable):** [Attach any relevant screenshots to help illustrate the issue] ## Installation Method docker compose (Docker version 25.0.2, build 29cf629) ## Additional Information [Include any additional details that may help in understanding and reproducing the issue. This could include specific configurations, error messages, or anything else relevant to the bug.] ## Note If the bug report is incomplete or does not follow the provided instructions, it may not be addressed. Please ensure that you have followed the steps outlined in the README.md and troubleshooting.md documents, and provide all necessary information for us to reproduce and address the issue. Thank you!
Author
Owner

@justinh-rahb commented on GitHub (Feb 6, 2024):

Out of scope for this project. This is related to caching the model files in memory for some time after loading them. The behaviour is tunable, but again, out of scope for this project, please refer to Ollama.

@justinh-rahb commented on GitHub (Feb 6, 2024): Out of scope for this project. This is related to caching the model files in memory for some time after loading them. The behaviour is tunable, but again, out of scope for this project, please refer to Ollama.
Author
Owner

@tgsca commented on GitHub (Feb 6, 2024):

Thank you for your response. Understand what you mean and was not sure if this could be of interest for this project. But feedback fully understandable. Thx 👍

@tgsca commented on GitHub (Feb 6, 2024): Thank you for your response. Understand what you mean and was not sure if this could be of interest for this project. But feedback fully understandable. Thx 👍
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: github-starred/open-webui#271