Package edu.wisc.ssec.mcidasv.util
Class GetMem
java.lang.Object
edu.wisc.ssec.mcidasv.util.GetMem
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 Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic StringGet total system memory and print it out--accounts for 32bit JRE limitation of 1.5GB.static voidThe main.private static <T> TqueryPlatformBean(String attrName, T defaultValue) Query anOperatingSystemMXBeanattribute and return the result.
-
Constructor Details
-
GetMem
public GetMem()
-
-
Method Details
-
queryPlatformBean
Query anOperatingSystemMXBeanattribute and return the result.- Type Parameters:
T- Type of the expected return value anddefaultValue.- Parameters:
attrName- Name of theOperatingSystemMXBeanattribute to query. Cannot benullor empty.defaultValue- Value returned ifattrNamecould not be queried.- Returns:
- Either the value corresponding to
attrNameordefaultValue.
-
getMemory
Get total system memory and print it out--accounts for 32bit JRE limitation of 1.5GB.- Returns:
Stringrepresentation of the total amount of system memory.
-
main
The main. Get total system memory and print it out.- Parameters:
args- Ignored.
-