Package ucar.nc2.dt.ugrid.utils
Class AsaMemoryUtils
java.lang.Object
ucar.nc2.dt.ugrid.utils.AsaMemoryUtils
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic classa static class used in converting between bytes, megabytes, and gigabytes -
Field Summary
Fields -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic doublefreeMemoryAs(int sizeType) Returns the amount of free memory in the Java Virtual Machine in units denoted bysizeTypestatic doubletotalMemoryAs(int sizeType) Returns the total amount of memory in the Java Virtual Machine in units denoted bysizeType
-
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 bysizeType- Parameters:
sizeType- the type of units to report the JVM's free memory. Valid values are:com.asascience.utilities.Utils.Memory.BYTEcom.asascience.utilities.Utils.Memory.MEGABYTEcom.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 bysizeType- Parameters:
sizeType- the type of units to report the JVM's free memory. Valid values are:com.asascience.utilities.Utils.Memory.BYTEcom.asascience.utilities.Utils.Memory.MEGABYTEcom.asascience.utilities.Utils.Memory.GIGABYTE
- Returns:
- the total amount of memory in the Java Virtual Machine
TODO: if sizeType = 0, Double.NaN is returned
-