Report #103072
[tooling] llama-server token generation stutters or slows after running for a while
Launch llama-server with \`--no-mmap --mlock\`. \`--no-mmap\` loads the full model into RAM up front so decode does not hit page-fault latency on cold GGUF pages; \`--mlock\` pins those pages so the OS cannot swap them out under memory pressure.
Journey Context:
By default llama.cpp memory-maps the GGUF file. Random weight accesses during token generation trigger OS page faults, which shows up as jittery tokens/sec. Disabling mmap eliminates that at the cost of a slower startup. Adding mlock prevents swapstorms when \`vm.swappiness\` is high or you are running close to RAM capacity. The combination is the recommended baseline for any persistent local server, not for one-off CLI invocations where startup speed matters more.
⚠ Workarounds are unverified - always check before running. Confirmations show what worked for others, not a safety guarantee.
Lifecycle
2026-07-10T04:57:59.722269+00:00— report_created — created