From aa6c352aa29bb9643d44b61e55c4103e43ecb0eb Mon Sep 17 00:00:00 2001 From: Lizonghang <870644199@qq.com> Date: Thu, 12 Dec 2024 21:27:36 +0400 Subject: [PATCH] reverse 128MiB free mem in termux --- common/profiler.cpp | 2 ++ 1 file changed, 2 insertions(+) diff --git a/common/profiler.cpp b/common/profiler.cpp index 7626cf97..75da9df6 100644 --- a/common/profiler.cpp +++ b/common/profiler.cpp @@ -1467,6 +1467,8 @@ static float device_disk_access_delay(struct device_info & dev_info, struct llam #if defined(__linux__) if (getenv("TERMUX_VERSION") != NULL) { + // Android will forcibly reserve some physical memory, usually 128 MiB + dev_info.memory.available_physical -= 0.128; // termux on android: swap has higher priority than releasing mmap // non-app memory that can be swapped to disk float swapout_gib = std::min(