[GH-ISSUE #15021] sqlite memory leak #9649

Open
opened 2026-04-12 22:32:30 -05:00 by GiteaMirror · 1 comment
Owner

Originally created by @long76 on GitHub (Mar 23, 2026).
Original GitHub issue: https://github.com/ollama/ollama/issues/15021

What is the issue?

  1. run ollama
  2. make one or many long chats with ai
  3. remove all chats
  4. close(quit) ollama
  5. go to %localappdata%\Ollama
  6. db.sqlite have big size

solution: made VACUUM and REINDEX sqlite on quit ollama

Relevant log output


OS

Windows

GPU

No response

CPU

No response

Ollama version

0.18.2

Originally created by @long76 on GitHub (Mar 23, 2026). Original GitHub issue: https://github.com/ollama/ollama/issues/15021 ### What is the issue? 1) run ollama 2) make one or many long chats with ai 3) remove all chats 4) close(quit) ollama 5) go to `%localappdata%\Ollama` 6) `db.sqlite` have big size solution: made `VACUUM` and `REINDEX` sqlite on quit ollama ### Relevant log output ```shell ``` ### OS Windows ### GPU _No response_ ### CPU _No response_ ### Ollama version 0.18.2
GiteaMirror added the bug label 2026-04-12 22:32:30 -05:00
Author
Owner

@BillionClaw commented on GitHub (Mar 24, 2026):

Looking into this — sqlite memory leak suggests connections or prepared statements aren't being closed properly. I'll find the sqlite usage in the codebase and add proper cleanup.

<!-- gh-comment-id:4115370795 --> @BillionClaw commented on GitHub (Mar 24, 2026): Looking into this — sqlite memory leak suggests connections or prepared statements aren't being closed properly. I'll find the sqlite usage in the codebase and add proper cleanup.
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: github-starred/ollama#9649