Intent to automate diagnosis with MAT Java APIs [message #730834] |
Thu, 29 September 2011 10:18  |
Eclipse User |
|
|
|
MAT Dev Team:
Once "Memory Analyzer" tool provides Leak-suspect report, we need to further
spend a good amount of time to complete the exact root-cause OR 'source of issue', when the actual java Enterprise-Application is quite large-scale.
In this context, I would like to see how much of the "Root-cause" analysis
of Heapdump file can be automated, with the assumption that Application-framework
knowledge can be programmed into the debugging-code.
So, would like to check with the MAT-Dev team, if they expose MAT as "jar-files",
(and corresponding Java-doc), so that consumers (like us) can see how effectively
they can automate this triaging / debugging process.
In other words, instead of manually triaging, we are looking forward to use the
java methods directly, to retrieve the Leak-suspects, and then traverse
thro Histogram programatically, and further traverse programatically through
other data-set.
Thanks a lot for this help.
Regards,
Vinod
|
|
|
|
Re: Intent to automate diagnosis with MAT Java APIs [message #732155 is a reply to message #730846] |
Tue, 04 October 2011 05:05   |
Eclipse User |
|
|
|
Hi Krum,
Thanks for your quick response.
We tried leveraging the MAT supplier-jars and build our initial code, starting with SnapshotFactory.openSnapshot. However, we are unable to progress due to below exception:
*** Hprof can be read true
Exception in thread "main" java.lang.ExceptionInInitializerError
at oracle.apps.test.main(test.java:21)
Caused by: java.lang.NullPointerException
at org.eclipse.mat.snapshot.SnapshotFactory.<clinit>(SnapshotFactory.java:84)
... 1 more
Process exited with exit code 1.
Note:
1) In SnapshotFactory.java, Line 84 corresponds to
IExtensionPoint extensionPoint = Platform.getExtensionRegistry().getExtensionPoint(MATPlugin.PLUGIN_ID + ".factory"); //$NON-NLS-
2) Value of MATPlugin.PLUGIN_ID is "org.eclipse.mat.api"
Help Needed:
1. Can you pls review the attached source code & let us know where we are wrong
2. Also, can this automating be developed without using Eclipse IDE OR does it have a dependency, as we use a difft IDE for internal development ? If Yes, are there any config params, which need to be setup?
|
|
|
Re: Intent to automate diagnosis with MAT Java APIs [message #732156 is a reply to message #732155] |
Tue, 04 October 2011 05:07   |
Eclipse User |
|
|
|
package abc.xyz;
import java.io.File;
import org.eclipse.mat.SnapshotException;
import org.eclipse.mat.snapshot.ISnapshot;
import org.eclipse.mat.snapshot.SnapshotFactory;
import org.eclipse.mat.util.VoidProgressListener;
public class test {
public test() {
super();
}
public static void main(String[] args) throws SnapshotException
{
File hproFile = new File("/home/dev", "jrockit_7138.hprof");
System.out.println("*** Hprof can be read " + hproFile.canRead());
ISnapshot snapShot = SnapshotFactory.openSnapshot(hproFile, new VoidProgressListener());
try
{
snapShot.getHistogram(new VoidProgressListener());
} finally
{
System.out.println("Finally Block");
SnapshotFactory.dispose(snapShot);
}
}
}
|
|
|
|
Powered by
FUDForum. Page generated in 0.03171 seconds