From 5a1ebe906da37849877d8ea3cc7fb6c8d16dc379 Mon Sep 17 00:00:00 2001 From: huanghongxun Date: Sun, 29 Aug 2021 04:27:31 +0800 Subject: [PATCH] fix: no longer check linux for free memory size. --- .../jackhuang/hmcl/util/platform/OperatingSystem.java | 9 --------- 1 file changed, 9 deletions(-) diff --git a/HMCLCore/src/main/java/org/jackhuang/hmcl/util/platform/OperatingSystem.java b/HMCLCore/src/main/java/org/jackhuang/hmcl/util/platform/OperatingSystem.java index c7f54e73a..29b2535bc 100644 --- a/HMCLCore/src/main/java/org/jackhuang/hmcl/util/platform/OperatingSystem.java +++ b/HMCLCore/src/main/java/org/jackhuang/hmcl/util/platform/OperatingSystem.java @@ -135,15 +135,6 @@ public enum OperatingSystem { com.sun.management.OperatingSystemMXBean sunBean = (com.sun.management.OperatingSystemMXBean) java.lang.management.ManagementFactory.getOperatingSystemMXBean(); - - if (CURRENT_OS == LINUX) { - // On Linux, real amount of memory that is free for using is "available" size of memory, - // which also includes size of memory for caching that can be make use of. - // But available size of memory cannot be obtained by OperatingSystemMXBean interface. - // So we simply disable reporting free physical memory size on Linux. - return Optional.of(new PhysicalMemoryStatus(sunBean.getTotalPhysicalMemorySize(), -1)); - } - return Optional.of(new PhysicalMemoryStatus(sunBean.getTotalPhysicalMemorySize(), sunBean.getFreePhysicalMemorySize())); } return Optional.empty();