diff --git a/iotdb-core/metrics/interface/src/main/java/org/apache/iotdb/metrics/metricsets/system/SystemMetrics.java b/iotdb-core/metrics/interface/src/main/java/org/apache/iotdb/metrics/metricsets/system/SystemMetrics.java index 27f31bf09aa1..1cacf2bf6f5f 100644 --- a/iotdb-core/metrics/interface/src/main/java/org/apache/iotdb/metrics/metricsets/system/SystemMetrics.java +++ b/iotdb-core/metrics/interface/src/main/java/org/apache/iotdb/metrics/metricsets/system/SystemMetrics.java @@ -227,11 +227,11 @@ private void updateLinuxSystemMemInfo() { result.append(line).append("\n"); } } - String[] lines = result.toString().split("\n"); + String[] lines = result.toString().trim().split("\n"); // if failed to get result if (lines.length >= 2) { String[] memParts = lines[1].trim().split("\\s+"); - if (memParts.length == linuxMemoryTitles.length) { + if (memParts.length >= linuxMemoryTitles.length) { usedMemory = Long.parseLong(memParts[2]) * 1024; sharedMemory = Long.parseLong(memParts[4]) * 1024; buffCacheMemory = Long.parseLong(memParts[5]) * 1024;