Class GetMem

java.lang.Object
edu.wisc.ssec.mcidasv.util.GetMem

public class GetMem extends Object
Wrapper for OperatingSystemMXBean.

Note: this class is likely to be used in contexts where we don't have logging set up, so System.err and System.out are used.

  • Constructor Details

  • Method Details

    • queryPlatformBean

      private static <T> T queryPlatformBean(String attrName, T defaultValue)
      Query an OperatingSystemMXBean attribute and return the result.
      Type Parameters:
      T - Type of the expected return value and defaultValue.
      Parameters:
      attrName - Name of the OperatingSystemMXBean attribute to query. Cannot be null or empty.
      defaultValue - Value returned if attrName could not be queried.
      Returns:
      Either the value corresponding to attrName or defaultValue.
    • getMemory

      public static String getMemory()
      Get total system memory and print it out--accounts for 32bit JRE limitation of 1.5GB.
      Returns:
      String representation of the total amount of system memory.
    • main

      public static void main(String[] args)
      The main. Get total system memory and print it out.
      Parameters:
      args - Ignored.