Skip to content
Contents
GuidesOpenWrt

Why does LuCI show nearly full memory when htop shows room on OpenWrt?

Can you start another service if LuCI reports 96% used? Check Total Available first. Linux can reclaim some cache, so the two percentages can add up to more than 100%.

Can you start another service if LuCI reports 96% used? Check Total Available first. Linux can reclaim some cache, so the two percentages can add up to more than 100%.

Compare the two bars in Overview

Open Status → Overview and find Memory. Record Used, Total Available and Cached. These describe the whole router. The process page uses different measurements.

LuCI · Status → Overview → Memory
OpenWrt 25.12.6 · x86/64 · QEMU · Total Available 71% · Used 63%

On the OpenWrt 25.12 branch LuCI calculates Used as total minus completely free memory, including cache in Used. Total Available prefers a nonzero memory.available and may fall back to free plus buffered. Do not add Cached again.

Reconcile the values over SSH

Run these commands on the router close to a page refresh. Skip the version check if htop is absent.

ubus call system info | sed -n '/"memory": {/,/}/p'
grep -E '^(MemTotal|MemFree|MemAvailable|Buffers|Cached|SReclaimable|SwapFree):' /proc/meminfo
htop --version
logread | grep -iE 'out of memory|killed process' | tail -5
SSH · ubus · /proc/meminfo
OpenWrt 25.12.6 · x86/64 · QEMU · The screenshots are separate samples. The calculation uses terminal values in bytes. Divide by 1024 to compare with /proc/meminfo.
Used = (637452288 − 235769856) / 1048576 ≈ 383.1 MiB
Total Available = 457920512 / 1048576 ≈ 436.7 MiB

On Linux, htop 3.5.3 normally subtracts cache, reclaimable slab and buffers too, as shown below. In htop press F1 to check how your version colors cache and buffers, then quit with q. Avoid comparing one process’s RES or VIRT with system Used.

Linux · htop 3.5.3
usedDiff = MemFree + Cached + SReclaimable + Buffers
usedDiff ≤ MemTotal → usedMem = MemTotal − usedDiff
usedDiff > MemTotal → usedMem = MemTotal − MemFree

When to intervene

Compare idle, normal activity and the period after it ends. If available memory recovers and services respond, leave the cache alone. Before adding a service, measure its lowest headroom during startup and updates on a spare system.

If only the page stalls, retry ubus in another SSH window. If available memory keeps falling and logs show killed processes, pause the newest optional workload. Retest the dashboard and actual service before restoring tasks individually. Logs may have rotated. Read-only checks need no rollback.

Why does LuCI show more than 100% memory for a process when ps shows less?

Explore hardware

Comments