JAL-4409 Allow more URI schemes (e.g. file) to filter through to Jalview
[jalview.git] / getdown / src / getdown / core / src / main / java / jalview / bin / MemorySetting.java
index 55e304d..dbef0d9 100644 (file)
  */
 package jalview.bin;
 
+import java.util.Locale;
+
+import jalview.util.ErrorLog;
+
 /**
  * Methods to decide on appropriate memory setting for Jalview based on two
  * optionally provided values: jvmmempc - the maximum percentage of total
@@ -33,11 +37,12 @@ package jalview.bin;
  * @author bsoares
  *
  */
-
 public class MemorySetting
 {
+  // This must match the value of Arg.JVMMEMPC.getName()
   public static final String MAX_HEAPSIZE_PERCENT_PROPERTY_NAME = "jvmmempc";
 
+  // This must match the value of Arg.JVMMEMMAX.getName()
   public static final String MAX_HEAPSIZE_PROPERTY_NAME = "jvmmemmax";
 
   private static final int MAX_HEAPSIZE_PERCENT_DEFAULT = 90; // 90%
@@ -58,10 +63,10 @@ public class MemorySetting
           + "_CUSTOMISED_SETTINGS";
 
   public static final String MEMORY_JVMMEMPC = NS + "_"
-          + MAX_HEAPSIZE_PERCENT_PROPERTY_NAME.toUpperCase();
+          + MAX_HEAPSIZE_PERCENT_PROPERTY_NAME.toUpperCase(Locale.ROOT);
 
   public static final String MEMORY_JVMMEMMAX = NS + "_"
-          + MAX_HEAPSIZE_PROPERTY_NAME.toUpperCase();
+          + MAX_HEAPSIZE_PROPERTY_NAME.toUpperCase(Locale.ROOT);
 
   protected static boolean logToClassChecked = false;
 
@@ -353,7 +358,7 @@ public class MemorySetting
     else
     {
       // number too big for a Long. Limit to Long.MAX_VALUE
-      System.out.println("Memory parsing of '" + memString
+      ErrorLog.outPrintln("Memory parsing of '" + memString
               + "' produces number too big.  Limiting to Long.MAX_VALUE="
               + Long.MAX_VALUE);
       return Long.MAX_VALUE;
@@ -362,7 +367,7 @@ public class MemorySetting
 
   public static String memoryLongToString(long mem)
   {
-    return memoryLongToString(mem, "%.1f");
+    return memoryLongToString(mem, "%.3f");
   }
 
   public static String memoryLongToString(long mem, String format)
@@ -394,7 +399,7 @@ public class MemorySetting
     ADJUSTMENT_MESSAGE = reason;
     if (!quiet)
     {
-      System.out.println(reason);
+      ErrorLog.outPrintln(reason);
     }
   }
 
@@ -408,4 +413,4 @@ public class MemorySetting
     return ADJUSTMENT_MESSAGE;
   }
 
-}
\ No newline at end of file
+}