Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » Memory Analyzer » Intent to automate diagnosis with MAT Java APIs
Intent to automate diagnosis with MAT Java APIs [message #730834] Thu, 29 September 2011 10:18 Go to next message
venagara  is currently offline venagara Friend
Messages: 6
Registered: August 2011
Junior Member
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 #730846 is a reply to message #730834] Thu, 29 September 2011 10:50 Go to previous messageGo to next message
Krum Tsvetkov is currently offline Krum TsvetkovFriend
Messages: 164
Registered: July 2009
Senior Member
Hi,
Yes, there are some APIs you can use. Have a look at this link, and let me know to what extent this answers your question/fits your needs.
http://wiki.eclipse.org/index.php?title=MemoryAnalyzer/Contributor_Reference#Writing_plugins_for_the_Memory_Analyzer

Krum
Re: Intent to automate diagnosis with MAT Java APIs [message #732155 is a reply to message #730846] Tue, 04 October 2011 05:05 Go to previous messageGo to next message
venagara  is currently offline venagara Friend
Messages: 6
Registered: August 2011
Junior Member
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 Go to previous messageGo to next message
venagara  is currently offline venagara Friend
Messages: 6
Registered: August 2011
Junior Member
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);
}
}
}
Re: Intent to automate diagnosis with MAT Java APIs [message #733598 is a reply to message #732156] Wed, 05 October 2011 07:55 Go to previous message
Krum Tsvetkov is currently offline Krum TsvetkovFriend
Messages: 164
Registered: July 2009
Senior Member
Hi,

Have a look at this reply: http://www.eclipse.org/forums/index.php/mv/msg/243401/733596/#msg_733596
Does this answer your question?

Krum
Previous Topic:Memory Analyzer 1.1.1 is now released
Next Topic:SAXException when trying to run Leak Suspect report
Goto Forum:
  


Current Time: Wed Apr 24 13:57:40 GMT 2024

Powered by FUDForum. Page generated in 0.03051 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software

Back to the top