Package adams.core.management
Class JMap
- java.lang.Object
-
- adams.core.management.Java
-
- adams.core.management.JMap
-
public class JMap extends Java
A helper class for the jmap utility.- Version:
- $Revision$
- Author:
- fracpete (fracpete at waikato dot ac dot nz)
-
-
Field Summary
Fields Modifier and Type Field Description static String
EXECUTABLE
the jmap executable.-
Fields inherited from class adams.core.management.Java
BIN_DIR, CLASSPATH_FULL, CLASSPATH_SHORT, JAVA, JAVAC, MAJOR_VERSION
-
-
Constructor Summary
Constructors Constructor Description JMap()
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static String
execute(long pid)
Executes jmap with default options and returns the output.static String
execute(String options, long pid)
Executes jmap and returns the output.static String
execute(String executable, String options, long pid)
Executes jmap and returns the output.static String
getDefaultOptions()
Returns the default options ("-histo:live") for jmap.static String
getExecutablePath()
Returns the full path of the JMap executable, if possible.static boolean
isAvailable()
Checks whether jmap is available at all.-
Methods inherited from class adams.core.management.Java
canStopThread, execute, getBinDir, getBinDir, getClassPath, getHome, getJavaExecutable, getMajorVersion, isJDK, isJDK, isJRE, isJRE, main
-
-
-
-
Field Detail
-
EXECUTABLE
public static final String EXECUTABLE
the jmap executable.- See Also:
- Constant Field Values
-
-
Method Detail
-
isAvailable
public static boolean isAvailable()
Checks whether jmap is available at all.- Returns:
- true if available
-
getExecutablePath
public static String getExecutablePath()
Returns the full path of the JMap executable, if possible.- Returns:
- the full path of the executable if possible, otherwise just the executable
-
getDefaultOptions
public static String getDefaultOptions()
Returns the default options ("-histo:live") for jmap.- Returns:
- the default options
-
execute
public static String execute(long pid)
Executes jmap with default options and returns the output.- Parameters:
pid
- the process ID of the JVM to connect to, gets determined automatically if AUTO_PID- Returns:
- the output
- See Also:
getDefaultOptions()
,Java#AUTO_PID
-
execute
public static String execute(String options, long pid)
Executes jmap and returns the output.- Parameters:
options
- additional options for jmappid
- the process ID of the JVM to connect to, gets determined automatically if AUTO_PID- Returns:
- the output
- See Also:
Java#AUTO_PID
-
execute
public static String execute(String executable, String options, long pid)
Executes jmap and returns the output.- Parameters:
executable
- the jmap executable to useoptions
- additional options for jmappid
- the process ID of the JVM to connect to, gets determined automatically if AUTO_PID- Returns:
- the output
- See Also:
Java#AUTO_PID
-
-