Class AsaMemoryUtils

java.lang.Object
ucar.nc2.dt.ugrid.utils.AsaMemoryUtils

public class AsaMemoryUtils extends Object
  • Nested Class Summary

    Nested Classes
    Modifier and Type
    Class
    Description
    static class 
    a static class used in converting between bytes, megabytes, and gigabytes
  • Field Summary

    Fields
    Modifier and Type
    Field
    Description
    static int
     
    static int
     
    static int
     
  • Constructor Summary

    Constructors
    Constructor
    Description
     
  • Method Summary

    Modifier and Type
    Method
    Description
    static double
    freeMemoryAs(int sizeType)
    Returns the amount of free memory in the Java Virtual Machine in units denoted by sizeType
    static double
    totalMemoryAs(int sizeType)
    Returns the total amount of memory in the Java Virtual Machine in units denoted by sizeType

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Field Details

    • BYTE

      public static int BYTE
    • MEGABYTE

      public static int MEGABYTE
    • GIGABYTE

      public static int GIGABYTE
  • Constructor Details

    • AsaMemoryUtils

      public AsaMemoryUtils()
  • Method Details

    • freeMemoryAs

      public static double freeMemoryAs(int sizeType)
      Returns the amount of free memory in the Java Virtual Machine in units denoted by sizeType
      Parameters:
      sizeType - the type of units to report the JVM's free memory. Valid values are:
      • com.asascience.utilities.Utils.Memory.BYTE
      • com.asascience.utilities.Utils.Memory.MEGABYTE
      • com.asascience.utilities.Utils.Memory.GIGABYTE
      Returns:
      the total amount of free memory in the Java Virtual Machine
      TODO: if sizeType = 0, Double.NaN is returned
    • totalMemoryAs

      public static double totalMemoryAs(int sizeType)
      Returns the total amount of memory in the Java Virtual Machine in units denoted by sizeType
      Parameters:
      sizeType - the type of units to report the JVM's free memory. Valid values are:
      • com.asascience.utilities.Utils.Memory.BYTE
      • com.asascience.utilities.Utils.Memory.MEGABYTE
      • com.asascience.utilities.Utils.Memory.GIGABYTE
      Returns:
      the total amount of memory in the Java Virtual Machine
      TODO: if sizeType = 0, Double.NaN is returned