|
@@ -2412,10 +2412,20 @@ memory pressure:
|
|
|
loses no candidates; an LMDB read error there is an error, not a shorter
|
|
loses no candidates; an LMDB read error there is an error, not a shorter
|
|
|
answer.
|
|
answer.
|
|
|
- **The memory line** reads `..., of which vectors V MB (R more in LMDB
|
|
- **The memory line** reads `..., of which vectors V MB (R more in LMDB
|
|
|
- only), ...`: `V` is what is still in memory, `R` the number released. After
|
|
|
|
|
- a release of 16 MB or more the server calls `malloc_trim` so the freed
|
|
|
|
|
- memory goes back to the system. At boot the snapshot still loads every
|
|
|
|
|
- vector into memory (the boot peak is unchanged); the first tick releases them.
|
|
|
|
|
|
|
+ only), ...`: `V` is what is still in memory, `R` the number released. At
|
|
|
|
|
+ boot the snapshot still loads every vector into memory (the boot peak is
|
|
|
|
|
+ unchanged); the first tick releases them.
|
|
|
|
|
+- **The freed memory goes back to the system only with jemalloc's background
|
|
|
|
|
+ purge.** The packaged server allocates with jemalloc, and the systemd unit
|
|
|
|
|
+ sets `MALLOC_CONF=background_thread:true,dirty_decay_ms:1000,muzzy_decay_ms:1000`.
|
|
|
|
|
+ With it, RssAnon falls by the released vectors within seconds (measured: a
|
|
|
|
|
+ store with 194 MB of vectors went 367 -> 121 MB). **Without it** (the binary
|
|
|
|
|
+ started by hand or in a container that does not set it), jemalloc purges
|
|
|
|
|
+ only on allocation activity, so an idle process keeps the pages: the same
|
|
|
|
|
+ store went 371 -> 339 MB and stayed there, while the estimate fell by the
|
|
|
|
|
+ full 194 MB. Run the server with the unit's `MALLOC_CONF` wherever it runs.
|
|
|
|
|
+ (The server also calls `malloc_trim` after a large release; that helps only
|
|
|
|
|
+ a build linked against glibc malloc.)
|
|
|
|
|
|
|
|
Not changed: the first search on a collection still reads its vectors from
|
|
Not changed: the first search on a collection still reads its vectors from
|
|
|
disk into the page cache (about `rows x dimension x 4` bytes). With the
|
|
disk into the page cache (about `rows x dimension x 4` bytes). With the
|