edu.wisc.ssec.mcidasv.util
Class GetMem

java.lang.Object
  extended by edu.wisc.ssec.mcidasv.util.GetMem

public class GetMem
extends Object

Wrapper for OperatingSystemMXBean


Constructor Summary
GetMem()
           
 
Method Summary
private
<T> T
callMXBeanMethod(String methodName, T defaultValue)
          Call a method belonging to OperatingSystemMXBean and return the result.
static String getMemory()
          Get total system memory and print it out--accounts for 32bit JRE limitation of 1.5GB.
static void main(String[] args)
          The main.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

GetMem

public GetMem()
Method Detail

callMXBeanMethod

private <T> T callMXBeanMethod(String methodName,
                               T defaultValue)
Call a method belonging to OperatingSystemMXBean and return the result.

Type Parameters:
T - Type of the expected return and defaultValue.
Parameters:
methodName - Name of the OperatingSystemMXBean method to call. Cannot be null or empty.
defaultValue - Value to return if the call to methodName fails.
Returns:
Either the value returned by the methodName call, or defaultValue.

getMemory

public static String getMemory()
                        throws Exception
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.
Throws:
Exception

main

public static void main(String[] args)
The main. Get total system memory and print it out.

Parameters:
args - Ignored.