| 206 | } |
| 207 | |
| 208 | std::string page_cache_hint(const std::string& meminfo_text) { |
| 209 | const uint64_t cache = meminfo_bytes(meminfo_text, "Cached") + meminfo_bytes(meminfo_text, "Buffers"); |
| 210 | if (cache < (1ull << 30)) return ""; |
| 211 | char msg[420]; |
| 212 | std::snprintf(msg, sizeof msg, |
| 213 | "; %.1f GiB of the RAM is file cache (earlier runs' model files, which Linux gives back on demand - " |
| 214 | "'free' showing little is normal). If the start still fails, free it with: " |
| 215 | "sync; echo 1 | sudo tee /proc/sys/vm/drop_caches (or start strata serve with " |
| 216 | "STRATA_DROP_CACHE_ON_EXIT=1 so it releases its model files when it stops)", |
| 217 | (double) cache / 1073741824.0); |
| 218 | return msg; |
| 219 | } |
| 220 | |
| 221 | bool make_cache_complement_plan( |
| 222 | int64_t n_layers, int64_t n_expert, const std::vector<uint64_t>& layer_blob_bytes, |