[GH-ISSUE #1902] Extremely slow memory allocation in WSL2 container #47605

Closed
opened 2026-04-28 04:29:18 -05:00 by GiteaMirror · 7 comments
Owner

Originally created by @otavio-silva on GitHub (Jan 10, 2024).
Original GitHub issue: https://github.com/ollama/ollama/issues/1902

Originally assigned to: @dhiltgen on GitHub.

Description

When trying to run ollama inside a container, memory allocation is extremely slow, something like 50 MB/s max. When in chat with the model, the container releases memory after some time if idle and if I run a prompt, it allocates it all over again.

Steps to reproduce

  1. Run the command podman run --device nvidia.com/gpu=all --security-opt label=disable --detach --volume .ollama:/root/.ollama -p 11434:11434 --name ollama-19 ollama/ollama:0.1.19
  2. Run the command podman exec -it ollama-19 ollama run dolphin-mixtral
  3. Wait for several minutes

System info

Nome do host:                              GE76RAIDER
Nome do sistema operacional:               Microsoft Windows 11 Pro
Versão do sistema operacional:             10.0.22631 N/A compilação 22631
Fabricante do sistema operacional:         Microsoft Corporation
Configuração do SO:                        Estação de trabalho autônoma
Tipo de compilação do sistema operacional: Multiprocessor Free
Proprietário registrado:                   otavioasilva@hotmail.com
Organização registrada:                    N/A
Identificação do produto:                  00330-80000-00000-AA520
Data da instalação original:               02/08/2023, 14:30:14
Tempo de Inicialização do Sistema:         10/01/2024, 12:32:44
Fabricante do sistema:                     Micro-Star International Co., Ltd.
Modelo do sistema:                         Raider GE76 12UHS
Tipo de sistema:                           x64-based PC
Processador(es):                           1 processador(es) instalado(s).
                                           [01]: Intel64 Family 6 Model 154 Stepping 3 GenuineIntel ~2900 Mhz
Versão do BIOS:                            American Megatrends International, LLC. E17K4IMS.20D, 26/06/2023
Pasta do Windows:                          C:\WINDOWS
Pasta do sistema:                          C:\WINDOWS\system32
Inicializar dispositivo:                   \Device\HarddiskVolume1
Localidade do sistema:                     pt-br;Português (Brasil)
Localidade de entrada:                     en-us;Inglês (Estados Unidos)
Fuso horário:                              (UTC-03:00) Brasília
Memória física total:                      65.237 MB
Memória física disponível:                 46.571 MB
Memória Virtual: Tamanho Máximo:           74.965 MB
Memória Virtual: Disponível:               50.991 MB
Memória Virtual: Em Uso:                   23.974 MB
Local(is) de arquivo de paginação:         C:\pagefile.sys
Domínio:                                   WORKGROUP
Servidor de Logon:                         \\GE76RAIDER
Hotfix(es):                                4 hotfix(es) instalado(s).
                                           [01]: KB5033920
                                           [02]: KB5027397
                                           [03]: KB5034123
                                           [04]: KB5032393
Placa(s) de Rede:                          3 NIC(s) instalado(s).
                                           [01]: Killer E3100G 2.5 Gigabit Ethernet Controller
                                                 Nome da conexão: Ethernet
                                                 Status:          Mídia desconectada
                                           [02]: Killer(R) Wi-Fi 6E AX1675i 160MHz Wireless Network Adapter (211NGW)
                                                 Nome da conexão: Wi-Fi
                                                 DHCP ativado:    Sim
                                                 Servidor DHCP:   192.168.1.1
                                                 Endereço(es) IP
                                                 [01]: 192.168.1.26
                                           [03]: TAP-Windows Adapter V9
                                                 Nome da conexão: TAP-Windows
                                                 Status:          Mídia desconectada
Requisitos do Hyper-V:                     Hipervisor detectado. Recursos necessários para o Hyper-V não serão exibidos.

Originally created by @otavio-silva on GitHub (Jan 10, 2024). Original GitHub issue: https://github.com/ollama/ollama/issues/1902 Originally assigned to: @dhiltgen on GitHub. # Description When trying to run ollama inside a container, memory allocation is extremely slow, something like 50 MB/s max. When in chat with the model, the container releases memory after some time if idle and if I run a prompt, it allocates it all over again. # Steps to reproduce 1. Run the command `podman run --device nvidia.com/gpu=all --security-opt label=disable --detach --volume .ollama:/root/.ollama -p 11434:11434 --name ollama-19 ollama/ollama:0.1.19` 2. Run the command `podman exec -it ollama-19 ollama run dolphin-mixtral` 3. Wait for several minutes # System info ``` Nome do host: GE76RAIDER Nome do sistema operacional: Microsoft Windows 11 Pro Versão do sistema operacional: 10.0.22631 N/A compilação 22631 Fabricante do sistema operacional: Microsoft Corporation Configuração do SO: Estação de trabalho autônoma Tipo de compilação do sistema operacional: Multiprocessor Free Proprietário registrado: otavioasilva@hotmail.com Organização registrada: N/A Identificação do produto: 00330-80000-00000-AA520 Data da instalação original: 02/08/2023, 14:30:14 Tempo de Inicialização do Sistema: 10/01/2024, 12:32:44 Fabricante do sistema: Micro-Star International Co., Ltd. Modelo do sistema: Raider GE76 12UHS Tipo de sistema: x64-based PC Processador(es): 1 processador(es) instalado(s). [01]: Intel64 Family 6 Model 154 Stepping 3 GenuineIntel ~2900 Mhz Versão do BIOS: American Megatrends International, LLC. E17K4IMS.20D, 26/06/2023 Pasta do Windows: C:\WINDOWS Pasta do sistema: C:\WINDOWS\system32 Inicializar dispositivo: \Device\HarddiskVolume1 Localidade do sistema: pt-br;Português (Brasil) Localidade de entrada: en-us;Inglês (Estados Unidos) Fuso horário: (UTC-03:00) Brasília Memória física total: 65.237 MB Memória física disponível: 46.571 MB Memória Virtual: Tamanho Máximo: 74.965 MB Memória Virtual: Disponível: 50.991 MB Memória Virtual: Em Uso: 23.974 MB Local(is) de arquivo de paginação: C:\pagefile.sys Domínio: WORKGROUP Servidor de Logon: \\GE76RAIDER Hotfix(es): 4 hotfix(es) instalado(s). [01]: KB5033920 [02]: KB5027397 [03]: KB5034123 [04]: KB5032393 Placa(s) de Rede: 3 NIC(s) instalado(s). [01]: Killer E3100G 2.5 Gigabit Ethernet Controller Nome da conexão: Ethernet Status: Mídia desconectada [02]: Killer(R) Wi-Fi 6E AX1675i 160MHz Wireless Network Adapter (211NGW) Nome da conexão: Wi-Fi DHCP ativado: Sim Servidor DHCP: 192.168.1.1 Endereço(es) IP [01]: 192.168.1.26 [03]: TAP-Windows Adapter V9 Nome da conexão: TAP-Windows Status: Mídia desconectada Requisitos do Hyper-V: Hipervisor detectado. Recursos necessários para o Hyper-V não serão exibidos. ```
GiteaMirror added the bugwindows labels 2026-04-28 04:29:18 -05:00
Author
Owner

@otavio-silva commented on GitHub (Jan 19, 2024):

Any news on this?

<!-- gh-comment-id:1900768686 --> @otavio-silva commented on GitHub (Jan 19, 2024): Any news on this?
Author
Owner

@Hansson0728 commented on GitHub (Jan 19, 2024):

Probably related to the timeout that unloads the model after 5 min

<!-- gh-comment-id:1901269641 --> @Hansson0728 commented on GitHub (Jan 19, 2024): Probably related to the timeout that unloads the model after 5 min
Author
Owner

@otavio-silva commented on GitHub (Jan 20, 2024):

@Hansson0728 I don't think they are related, although Ollama offloading the model while I'm still on a chat with it is definitely annoying.

<!-- gh-comment-id:1901507031 --> @otavio-silva commented on GitHub (Jan 20, 2024): @Hansson0728 I don't think they are related, although Ollama offloading the model while I'm still on a chat with it is definitely annoying.
Author
Owner

@phong-phuong commented on GitHub (Mar 8, 2024):

Are you using windows native folder as the volume? There are known performance issues with it.
Instead you use the native docker volume or the equivalent for podman.

<!-- gh-comment-id:1986548316 --> @phong-phuong commented on GitHub (Mar 8, 2024): Are you using windows native folder as the volume? There are known performance issues with it. Instead you use the native docker volume or the equivalent for podman.
Author
Owner

@dhiltgen commented on GitHub (Mar 12, 2024):

If it's not volume related, my suspicion is there may be an AV system that's causing a performance impact. (Windows Defender, etc.)

Do you see the same performance problems when running the native Windows version of Ollama?

<!-- gh-comment-id:1992280662 --> @dhiltgen commented on GitHub (Mar 12, 2024): If it's not volume related, my suspicion is there may be an AV system that's causing a performance impact. (Windows Defender, etc.) Do you see the same performance problems when running the native Windows version of Ollama?
Author
Owner

@otavio-silva commented on GitHub (Mar 14, 2024):

@dhiltgen the issue does not occur in the native Windows version, only in the container one

<!-- gh-comment-id:1997626994 --> @otavio-silva commented on GitHub (Mar 14, 2024): @dhiltgen the issue does not occur in the native Windows version, only in the container one
Author
Owner

@jmorganca commented on GitHub (May 10, 2024):

As mentioned by a few other folks I think this just may be resource constraints from running in WSL2 – Ollama now has a native Windows version you can download here: https://ollama.com/download/windows

<!-- gh-comment-id:2103664723 --> @jmorganca commented on GitHub (May 10, 2024): As mentioned by a few other folks I think this just may be resource constraints from running in WSL2 – Ollama now has a native Windows version you can download here: https://ollama.com/download/windows
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: github-starred/ollama#47605