[GH-ISSUE #10076] Ollama doesn't release RAM #68662

Open
opened 2026-05-04 14:46:46 -05:00 by GiteaMirror · 1 comment
Owner

Originally created by @ayushkevich on GitHub (Apr 1, 2025).
Original GitHub issue: https://github.com/ollama/ollama/issues/10076

What is the issue?

I have the following PC configuration:

  1. CPU: AMD Ryzen 7700
  2. GPU: GeForce RTX 3060 12 GB
  3. RAM: 32 GB

I attempted to run QwQ:32b in ollama inside docker container. It filled almost all RAM. RAM wasn't cleared after the model execution. I checked docker stats and I found that ollama container uses 20 GB RAM. I attempted to stop model inside container and restart container but docker stats show that ollama container uses < 1 GB RAM, however the system sees 20 GB usage.
Can anybody help me with fixing this issue?

Relevant log output

CONTAINER ID   NAME         CPU %     MEM USAGE / LIMIT     MEM %     NET I/O           BLOCK I/O        PIDS
ed751f322c16   open-webui   0.10%     746.4MiB / 30.46GiB   2.39%     25.9kB / 7.07kB   422MB / 12.3kB   38
519abddc8517   ollama       0.00%     18MiB / 30.46GiB      0.06%     5.91kB / 126B     0B / 0B          12

Image

OS

Linux

GPU

Nvidia

CPU

AMD

Ollama version

0.6.2

Originally created by @ayushkevich on GitHub (Apr 1, 2025). Original GitHub issue: https://github.com/ollama/ollama/issues/10076 ### What is the issue? I have the following PC configuration: 1. CPU: AMD Ryzen 7700 2. GPU: GeForce RTX 3060 12 GB 3. RAM: 32 GB I attempted to run QwQ:32b in ollama inside docker container. It filled almost all RAM. RAM wasn't cleared after the model execution. I checked docker stats and I found that ollama container uses 20 GB RAM. I attempted to stop model inside container and restart container but docker stats show that ollama container uses < 1 GB RAM, however the system sees 20 GB usage. Can anybody help me with fixing this issue? ### Relevant log output ```shell CONTAINER ID NAME CPU % MEM USAGE / LIMIT MEM % NET I/O BLOCK I/O PIDS ed751f322c16 open-webui 0.10% 746.4MiB / 30.46GiB 2.39% 25.9kB / 7.07kB 422MB / 12.3kB 38 519abddc8517 ollama 0.00% 18MiB / 30.46GiB 0.06% 5.91kB / 126B 0B / 0B 12 ``` ![Image](https://github.com/user-attachments/assets/88bf75c1-f03c-4c45-a0de-3a71553bd920) ### OS Linux ### GPU Nvidia ### CPU AMD ### Ollama version 0.6.2
GiteaMirror added the bug label 2026-05-04 14:46:46 -05:00
Author
Owner

@ayushkevich commented on GitHub (Apr 2, 2025):

I attempted to use ollama 0.6.3 and gemma 27b and it works fine. I attempted to use QwQ and here is the result of console commands execution:

~$ docker stats --no-stream
CONTAINER ID   NAME         CPU %     MEM USAGE / LIMIT     MEM %     NET I/O           BLOCK I/O         PIDS
0dd08cb728c4   ollama       0.13%     20.1GiB / 30.46GiB    66.01%    18.2GB / 462MB    41.9GB / 17.9GB   37
ed751f322c16   open-webui   0.10%     67.11MiB / 30.46GiB   0.22%     1.62MB / 6.84MB   660MB / 539MB     39
~$ docker stop ollama
ollama
~$ docker start ollama
ollama
~$ docker stats --no-stream
CONTAINER ID   NAME         CPU %     MEM USAGE / LIMIT     MEM %     NET I/O           BLOCK I/O       PIDS
0dd08cb728c4   ollama       0.00%     18.4MiB / 30.46GiB    0.06%     3.75kB / 126B     53.2kB / 0B     11
ed751f322c16   open-webui   0.08%     67.16MiB / 30.46GiB   0.22%     1.62MB / 6.85MB   660MB / 539MB   39
~$ free
               total        used        free      shared  buff/cache   available
Mem:        31935044    16048308     5755192       69300    10662744    15886736
Swap:        8099836     3333888     4765948

<!-- gh-comment-id:2772066221 --> @ayushkevich commented on GitHub (Apr 2, 2025): I attempted to use ollama 0.6.3 and gemma 27b and it works fine. I attempted to use QwQ and here is the result of console commands execution: ``` bash ~$ docker stats --no-stream CONTAINER ID NAME CPU % MEM USAGE / LIMIT MEM % NET I/O BLOCK I/O PIDS 0dd08cb728c4 ollama 0.13% 20.1GiB / 30.46GiB 66.01% 18.2GB / 462MB 41.9GB / 17.9GB 37 ed751f322c16 open-webui 0.10% 67.11MiB / 30.46GiB 0.22% 1.62MB / 6.84MB 660MB / 539MB 39 ~$ docker stop ollama ollama ~$ docker start ollama ollama ~$ docker stats --no-stream CONTAINER ID NAME CPU % MEM USAGE / LIMIT MEM % NET I/O BLOCK I/O PIDS 0dd08cb728c4 ollama 0.00% 18.4MiB / 30.46GiB 0.06% 3.75kB / 126B 53.2kB / 0B 11 ed751f322c16 open-webui 0.08% 67.16MiB / 30.46GiB 0.22% 1.62MB / 6.85MB 660MB / 539MB 39 ~$ free total used free shared buff/cache available Mem: 31935044 16048308 5755192 69300 10662744 15886736 Swap: 8099836 3333888 4765948 ```
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: github-starred/ollama#68662