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 String
Get total system memory and print it out--accounts for 32bit JRE limitation of 1.5GB.static void
The main.private static <T> T
queryPlatformBean
(String attrName, T defaultValue) Query anOperatingSystemMXBean
attribute and return the result.
-
Constructor Details
-
GetMem
public GetMem()
-
-
Method Details
-
queryPlatformBean
Query anOperatingSystemMXBean
attribute and return the result.- Type Parameters:
T
- Type of the expected return value anddefaultValue
.- Parameters:
attrName
- Name of theOperatingSystemMXBean
attribute to query. Cannot benull
or empty.defaultValue
- Value returned ifattrName
could not be queried.- Returns:
- Either the value corresponding to
attrName
ordefaultValue
.
-
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
The main. Get total system memory and print it out.- Parameters:
args
- Ignored.
-