fix(System): correct memory usage percentage calculation

The percentage was using (total - available) / total which excludes
reclaimable buffers/cache, but the displayed "Used RAM" value uses
mem.used which includes them. This mismatch showed 14% alongside
22 GB / 62 GB. Now uses mem.used / mem.total so the percentage
matches the displayed numbers.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
Chris Sherwood 2026-02-07 09:56:12 -08:00 committed by Jake Turner
parent b0be99700d
commit 812d13c3da

View File

@ -18,7 +18,7 @@ export default function SettingsPage(props: {
})
const memoryUsagePercent = info?.mem.total
? (((info.mem.total - info.mem.available) / info.mem.total) * 100).toFixed(1)
? ((info.mem.used / info.mem.total) * 100).toFixed(1)
: 0
const swapUsagePercent = info?.mem.swaptotal