public class GetMem extends java.lang.Object
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 and Description |
---|
GetMem() |
Modifier and Type | Method and Description |
---|---|
static java.lang.String |
getMemory()
Get total system memory and print it out--accounts for 32bit JRE
limitation of 1.5GB.
|
static void |
main(java.lang.String[] args)
The main.
|
private static <T> T |
queryPlatformBean(java.lang.String attrName,
T defaultValue)
Query an
OperatingSystemMXBean attribute and return the result. |
public GetMem()
private static <T> T queryPlatformBean(java.lang.String attrName, T defaultValue)
OperatingSystemMXBean
attribute and return the result.T
- Type of the expected return value and defaultValue
.attrName
- Name of the OperatingSystemMXBean
attribute to
query. Cannot be null
or empty.defaultValue
- Value returned if attrName
could not be
queried.attrName
or
defaultValue
.public static java.lang.String getMemory()
String
representation of the total amount of system
memory.public static void main(java.lang.String[] args)
args
- Ignored.