Merge branch 'bug/JAL-3477_memory_max_allocation' into develop
[jalview.git] / getdown / src / getdown / core / src / main / java / jalview / bin / GetMemory.java
@@ -3,9 +3,29 @@ package jalview.bin;
 import java.lang.management.ManagementFactory;
 import java.lang.management.OperatingSystemMXBean;
 
-public class MemoryPercent
+/**
+ * Isolated class to ascertain physical memory of the system using
+ * com.sun.management.OperatingSystemMXBean class's getTotalPhysicalMemorySize
+ * method. This class is present in OpenJDK 8,9,10,11,12,13. It is present but
+ * marked as deprecated in the early-access(30) release of OpenJDK 14. In case
+ * of an alternative/unsupported JRE being used or the class/method not being
+ * implemented in an exotic architecture JRE this call has been isolated into
+ * this separate class.
+ * 
+ * @author bsoares
+ *
+ */
+class GetMemory
 {
 
+  /**
+   * Wrapper for
+   * com.sun.management.OperatingSystemMXBean.getTotalPhysicalMemorySize()
+   * 
+   * @return Result of
+   *         com.sun.management.OperatingSystemMXBean.getTotalPhysicalMemorySize()
+   *         or -1 if this class is not present in the JRE.
+   */
   protected static long getPhysicalMemory()
   {
     final OperatingSystemMXBean o = ManagementFactory