Repository navigation
graftd stays small: no more thread pile-up per request, and long notes no longer leave gigabytes of RAM behind.
Fixed
graftdno longer grows to several GB of RAM and hundreds of threads. Two independent leaks are fixed (#28):- Threads. Every request used to leave
embedding.threads - 1threads behind (+10 per request withthreads: 11). Each connection runs on its own thread, and OpenMP in ggml keeps one worker team per calling thread. Every llama encode/decode now runs on one fixed thread per model context, so a single team is reused. - Memory. Embedding a long text used to keep about 1 MB of RAM per input token until the daemon exited (around 7 GB after a ~7,000-token note). The cause was an unused logits buffer of
n_vocab × n_tokensfloats that llama.cpp allocated even for embedding models. llama.cpp is updated to b12374, which skips that buffer. Embeddings are unchanged (cosine ≥ 0.9998 against the previous build), so existing databases need no re-embedding. A 32 KB input now peaks at about 50 MB above the idle footprint instead of 5.8 GB.
- Threads. Every request used to leave
- Building llama.cpp from source now passes
-DLLAMA_BUILD_APP=OFF. Newer llama.cpp adds a unifiedapp/target that does not compile withLLAMA_BUILD_COMMON=OFF.