From 8f758820e128a819e68359248f45b772fcf62c9e Mon Sep 17 00:00:00 2001 From: Liam Date: Wed, 17 Apr 2024 01:02:06 +0100 Subject: [PATCH] update memory metric --- .../backend/service/metric/metrics/process/MemoryMetric.java | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/main/java/xyz/mcutils/backend/service/metric/metrics/process/MemoryMetric.java b/src/main/java/xyz/mcutils/backend/service/metric/metrics/process/MemoryMetric.java index 04bb754..3cafc97 100644 --- a/src/main/java/xyz/mcutils/backend/service/metric/metrics/process/MemoryMetric.java +++ b/src/main/java/xyz/mcutils/backend/service/metric/metrics/process/MemoryMetric.java @@ -18,7 +18,8 @@ public class MemoryMetric extends MapMetric { public void collect() { Runtime runtime = Runtime.getRuntime(); - this.getValue().put("total", runtime.totalMemory()); + this.getValue().put("total", runtime.maxMemory()); + this.getValue().put("allocated", runtime.totalMemory()); this.getValue().put("used", runtime.totalMemory() - runtime.freeMemory()); } }