JAL-3477 New jvmmemmax config option in getdown and getdown config. Set to 32G cap.
[jalview.git] / src / jalview / bin / MemorySetting.java
index 7984f3e..ac1ac28 100644 (file)
@@ -12,6 +12,8 @@ public class MemorySetting
 
   private final static long maxHeapSizeDefault = 34359738368L; // 32GB
 
+  private final static long noMemMaxHeapSizeDefault = 8589934592L; // 8GB
+
   public final static String maxHeapSizeProperty = "jvmmemmax";
 
   public static long getMemorySetting()
@@ -153,11 +155,11 @@ public class MemorySetting
     }
     // In the case of an error reading the percentage if physical memory, let's cap maxMemLong to 8GB
     if (memoryPercentError && jvmmempc != null && pcmem == -1
-            && memmax > 8589934592L)
+            && memmax > noMemMaxHeapSizeDefault)
     {
       System.out.println(
               "Capping maximum memory to 8GB due to failure to read physical memory size.");
-      memmax = 8589934592L;
+      memmax = noMemMaxHeapSizeDefault;
     }
 
     if (pcmem == -1) // not set