From 4669573373b95003458439501c4829469a202d27 Mon Sep 17 00:00:00 2001 From: qiminbao Date: Fri, 31 Oct 2025 13:16:32 +0800 Subject: [PATCH] =?UTF-8?q?=E5=86=85=E5=AD=98=E5=88=A9=E7=94=A8=E7=8E=87?= =?UTF-8?q?=E6=95=B0=E6=8D=AE=E4=BC=98=E5=8C=96?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../agent/client/service/impl/SystemServiceImpl.java | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/src/main/java/com/tongran/agent/client/service/impl/SystemServiceImpl.java b/src/main/java/com/tongran/agent/client/service/impl/SystemServiceImpl.java index eeed138..a7a6ad8 100644 --- a/src/main/java/com/tongran/agent/client/service/impl/SystemServiceImpl.java +++ b/src/main/java/com/tongran/agent/client/service/impl/SystemServiceImpl.java @@ -160,10 +160,11 @@ public class SystemServiceImpl implements SystemService { memInfo.getOrDefault("Cached", 0L) + memInfo.getOrDefault("SReclaimable", 0L)); // 实际内存使用率 - long cached = memInfo.getOrDefault("Cached", 0L) + - memInfo.getOrDefault("SReclaimable", 0L); - long buffers = memInfo.getOrDefault("Buffers", 0L); - double actualUsage = (double)(total - available - cached - buffers) / total * 100; +// long cached = memInfo.getOrDefault("Cached", 0L) + +// memInfo.getOrDefault("SReclaimable", 0L); +// long buffers = memInfo.getOrDefault("Buffers", 0L); +// double actualUsage = (double)(total - available - cached - buffers) / total * 100; + double actualUsage = (double)(total - available) / total * 100; System.out.printf("实际内存使用率: %.2f%%\n", actualUsage); return actualUsage; } catch (IOException e) {