JAL-3477 A bit of refactoring for the better
[jalview.git] / src / jalview / bin / MemoryPercent.java
index 66c9859..3288e66 100644 (file)
@@ -21,33 +21,12 @@ public class MemoryPercent
     } catch (NoClassDefFoundError e)
     {
       // com.sun.management.OperatingSystemMXBean doesn't exist in this JVM
-      Cache.log.error("No com.sun.management.OperatingSystemMXBean");
+      System.err.println(
+              "No com.sun.management.OperatingSystemMXBean: cannot get total physical memory size");
     }
 
     // We didn't get a com.sun.management.OperatingSystemMXBean.
     return -1;
   }
 
-  public static long memPercent(int percent)
-  {
-    return memPercent(percent);
-  }
-  public static long memPercent(float percent)
-  {
-    long memPercent = -1;
-
-    long physicalMem = getPhysicalMemory();
-    if (physicalMem > MemorySetting.applicationMinMemory)
-    {
-      // try and set at least applicationMinMemory and thereafter ensure
-      // leaveFreeMinMemory is left for the OS
-      memPercent = Math.max(MemorySetting.applicationMinMemory,
-              (long) (physicalMem
-                      - Math.max(physicalMem * (100 - percent) / 100,
-                              MemorySetting.leaveFreeMinMemory)));
-    }
-
-    return memPercent;
-  }
-
 }