| java.lang.Object org.jboss.profiler.jvmti.JVMTIInterface
Inner Class :static class ClassSorterByClassLoader implements Comparator | |
Inner Class :static class ClassSorterByClassName implements Comparator | |
Method Summary | |
public boolean | compareInventories(PrintStream reportOutput, Map map1, Map map2, Class[] ignoredClasses, String[] prefixesToIgnore, InventoryDataPoint[] expectedIncreases) It will return true if the comparisson didn't represent any changes.
This can be used by JUnitTests to validate the consumption of the memory is on the expected results.
Parameters: reportOutput - You could set System.out here. | public HashMap | createIndexMatrix() This method tags the JVM and return an index. | public String | exploreClassReferences(String className, int maxLevel, boolean solveReferencesOnClasses, boolean solveReferencesOnClassLoaders, boolean useToString, boolean weakAndSoft, boolean printObjects) Show the reference holders tree of an object
Parameters: className - The name of the class to explore Parameters: maxLevel - The number of levels to explode. | public String | exploreClassReferences(String className, int maxLevel, boolean solveReferencesOnClasses, boolean solveReferencesOnClassLoaders, boolean useToString, boolean weakAndSoft, boolean printObjects, HashMap referencesMap) | public String | exploreObjectReferences(String className, int maxLevel, boolean useToString) Show the reference holders tree of an object. | public String | exploreObjectReferences(HashMap referencesMap, Object thatObject, int maxLevel, boolean useToString) Show the reference holders tree of an object. | native public void | forceGC() Force a GC. | public void | forceReleaseOnSoftReferences() Forces an OutOfMemoryError and releases the memory immediatly. | native public Object[] | getAllObjects(Class clazz) Will return all methods of a give class. | public Object[] | getAllObjects(String clazz) Return every single object on a give class by its name. | public Class | getClassByName(String className) | native public Class[] | getLoadedClasses() | native public Class | getMethodClass(long methodId) | native public String | getMethodName(long methodId) | native public String | getMethodSignature(long methodId) | public Field | getObjectField(Class clazz, int fieldId) Returns the field represted by the FieldId. | native public Object | getObjectOnTag(long tag) | native public Object[] | getReferenceHolders(Object[] objects) Will get all the objects holding references to these objects passed by parameter. | native public long | getTagOnObject(Object obj) | native protected static void | heapSnapshot(String classesFileName, String referencesFileName, String objectsFileName) | public void | heapSnapshot(String basicFileName, String suffix) | public String | inventoryReport() Will list the current memory inventory. | public boolean | isActive() | public String | listClassesHTMLReport() Will show a report of every class loaded on this JVM. | native public void | notifyInventory(boolean notifyOnClasses, String temporaryFileReferences, String temporaryFileObjects, JVMTICallBack callback) This method will keep every object tagged for later usage. | public void | notifyOnReferences(String temporaryFile, JVMTICallBack callback) | public String | printObjects(String className) Will print a report of every instance of the class passed by parameter. | public Map | produceInventory() Returns a WeakHashMap summarizing the current JVM's inventory. | native public void | releaseTags() Will release internal tags used by previous methods. | public Field[] | retrieveAllFields(Class clazz) | public Class[] | retrieveLoadedClasses() | public Collection | retrieveLoadedClassesByClassLoader() | public Collection | retrieveLoadedClassesByClassName() | public Object | treatReference(String level, PrintWriter out, ReferenceDataPoint point, boolean useToString) This is used by JSPs to have access to internal features formating results according to the navigations. |
compareInventories | public boolean compareInventories(PrintStream reportOutput, Map map1, Map map2, Class[] ignoredClasses, String[] prefixesToIgnore, InventoryDataPoint[] expectedIncreases)(Code) | | It will return true if the comparisson didn't represent any changes.
This can be used by JUnitTests to validate the consumption of the memory is on the expected results.
Parameters: reportOutput - You could set System.out here. The location where logging information is going to be sent. Parameters: map1 - The first snapshot. Parameters: map2 - The second snapshot. Parameters: ignoredClasses - Classes you want to ignore on the comparisson. Used to ignore things you know are going to be produced and you don't have control over the testcase. Parameters: prefixesToIgnore - Same thing as classes, but every classes starting with these prefixes are going to be ignored. Parameters: expectedIncreases - An array of InventoryDataPoint with the maximum number of instances each class could be generating. true if the assertion is okay |
createIndexMatrix | public HashMap createIndexMatrix() throws IOException(Code) | | This method tags the JVM and return an index. You can navigate through references using this returned HashMap.
This method can't be exposed through JMX as it would serialize a huge amount of data.
HashMap referencees> |
exploreClassReferences | public String exploreClassReferences(String className, int maxLevel, boolean solveReferencesOnClasses, boolean solveReferencesOnClassLoaders, boolean useToString, boolean weakAndSoft, boolean printObjects)(Code) | | Show the reference holders tree of an object
Parameters: className - The name of the class to explore Parameters: maxLevel - The number of levels to explode. Be careful as if you put this number too high, you migh endup in a forever loop, specially if your object is referencing something too generic Parameters: solveReferencesOnClass - Will expose the tree on the class Parameters: solveReferencesOnClassLoader - Will expode the tree on the classLoader (I mostly recommend to only look for classLoader's references) Parameters: useToString - If true, will use toString when an object is printed. If False will use className@ Parameters: weakAndSoft - If false, won't detail references on Weak and Soft References Parameters: printObject - If true, Will print (with toString) every single instance of the object passed as parameter |
exploreClassReferences | public String exploreClassReferences(String className, int maxLevel, boolean solveReferencesOnClasses, boolean solveReferencesOnClassLoaders, boolean useToString, boolean weakAndSoft, boolean printObjects, HashMap referencesMap)(Code) | | This is an overload to reuse the matrix index in case you already have indexed the JVM
|
exploreObjectReferences | public String exploreObjectReferences(String className, int maxLevel, boolean useToString)(Code) | | Show the reference holders tree of an object. This method is also exposed through MBean.
|
exploreObjectReferences | public String exploreObjectReferences(HashMap referencesMap, Object thatObject, int maxLevel, boolean useToString)(Code) | | Show the reference holders tree of an object. This returns a report you can visualize through MBean.
|
forceGC | native public void forceGC()(Code) | | Force a GC. This method doesn't use System.gc. If JVMTI is enabled this will really cause a FullGC by calling a JVMTI function.
|
forceReleaseOnSoftReferences | public void forceReleaseOnSoftReferences()(Code) | | Forces an OutOfMemoryError and releases the memory immediatly. This will force SoftReferences to go away.
|
getAllObjects | native public Object[] getAllObjects(Class clazz)(Code) | | Will return all methods of a give class. This will change tags, be careful if you are on the middle of navitations.
|
getAllObjects | public Object[] getAllObjects(String clazz)(Code) | | Return every single object on a give class by its name. This method will look for every single class with this name, and if more than one classLoader is loading a class with this name, this method will return objects for all the respective classes.
For example if you look for a Structs Action Form, this will return every ActionForm defined on the current JVM.
|
getClassByName | public Class getClassByName(String className)(Code) | | returns the first class found with a given name
|
getLoadedClasses | native public Class[] getLoadedClasses()(Code) | | |
getMethodClass | native public Class getMethodClass(long methodId)(Code) | | |
getMethodName | native public String getMethodName(long methodId)(Code) | | |
getMethodSignature | native public String getMethodSignature(long methodId)(Code) | | |
getObjectField | public Field getObjectField(Class clazz, int fieldId)(Code) | | Returns the field represted by the FieldId. This is used on field relationships according to the rule determined by JVMTI documentation.
|
getObjectOnTag | native public Object getObjectOnTag(long tag)(Code) | | Will return the object on a tag
|
getReferenceHolders | native public Object[] getReferenceHolders(Object[] objects)(Code) | | Will get all the objects holding references to these objects passed by parameter. This method is going to release tags, be careful if you are on the middle of navigations.
|
getTagOnObject | native public long getTagOnObject(Object obj)(Code) | | Will return the tag of an object
|
heapSnapshot | native protected static void heapSnapshot(String classesFileName, String referencesFileName, String objectsFileName)(Code) | | |
heapSnapshot | public void heapSnapshot(String basicFileName, String suffix)(Code) | | Will call
JVMTIInterface.heapSnapshot(String,String,String) passing "_classes, _references, _objects in the name of the files
|
inventoryReport | public String inventoryReport() throws Exception(Code) | | Will list the current memory inventory. Exposed through JMX.
|
isActive | public boolean isActive()(Code) | | Returns true if -agentlib:jbossAgent was configured properly
|
listClassesHTMLReport | public String listClassesHTMLReport() throws Exception(Code) | | Will show a report of every class loaded on this JVM. At the beggining of the report you will see duplicated classes (classes loaded in more than one classLoader)
|
notifyInventory | native public void notifyInventory(boolean notifyOnClasses, String temporaryFileReferences, String temporaryFileObjects, JVMTICallBack callback)(Code) | | This method will keep every object tagged for later usage. This method is going to tag objects.
|
printObjects | public String printObjects(String className) throws Exception(Code) | | Will print a report of every instance of the class passed by parameter. Exposed through JMX .
|
produceInventory | public Map produceInventory() throws IOException(Code) | | Returns a WeakHashMap summarizing the current JVM's inventory.
|
releaseTags | native public void releaseTags()(Code) | | Will release internal tags used by previous methods.
All the navigations through JVMTI are done through tagging. Calling this method will release any tagging done by previous methods.
|
retrieveLoadedClasses | public Class[] retrieveLoadedClasses()(Code) | | |
retrieveLoadedClassesByClassLoader | public Collection retrieveLoadedClassesByClassLoader()(Code) | | Used by JSPs and JMX to report
|
retrieveLoadedClassesByClassName | public Collection retrieveLoadedClassesByClassName()(Code) | | Used by JSPs and JMX to report
|
treatReference | public Object treatReference(String level, PrintWriter out, ReferenceDataPoint point, boolean useToString)(Code) | | This is used by JSPs to have access to internal features formating results according to the navigations. That's the only reason this method is public.
This is not intended to be used as part of the public API.
|
|
|