Skip to content

Find why llama.cpp does not scale down below 5 GB #142

Open

Description

@disconsented

The llama.cpp server does not release memory below about 5 GB, also when it is idle.

The README runs it with --sleep-idle-seconds 120, which should unload the model when idle. The E4B q4_0 model is much smaller than 5 GB, so the extra memory comes from somewhere else.

To do:

  • Measure the memory of the container when idle, after a request, and after the sleep timeout.
  • Check if sleep mode unloads the model, or only the KV cache.
  • Check the effect of -c, -np, the mmap settings (--no-mmap, --mlock) and the glibc allocator. Page cache from a mapped model file can also show as container memory.
  • Document the settings that let it scale down.

Activity

  1. added
    bug
    on Nov 1, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    bug

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions