| Using MemoryAnalyzer api's in Java [message #731221] |
Fri, 30 September 2011 06:11  |
pradeep Messages: 5 Registered: September 2011 |
Junior Member |
|
|
we wanted to use Memory Analyzer API's in our Java code (ie not writing extensions to MAT)...
Approach followed was to copy all jars(found in "plugin" folder of MemoryAnalyzer) to classpath of project .(in Jdeveloper)
and have sample progam to get "ISnapshot" of hprof file
Sample Program
=================
public static void main(String[] args) {
File hproffile=new File("scratch/ana1","jrockit_568.hprof");
ISnapshot iSnap=null;
VoidProgressListener progressListner=new VoidProgressListener();
try {
System.out.println("Opening .....");
iSnap= SnapshotFactory.openSnapshot(hproffile,progressListner);
System.out.println("done....");
} catch (SnapshotException e) {
e.printStackTrace();
}
finally{
System.out.println("Finally Block");
SnapshotFactory.dispose(iSnap);
}
}
Error while getting Platform's Extension registry
====================================================
was getting following runtime error
Caused by: java.lang.NullPointerException
at org.eclipse.mat.snapshot.SnapshotFactory.<clinit>(SnapshotFactory.java:82)
On checking "SnapshotFactory.java" ..found that it was failing while getting "extensionPoint"
IExtensionPoint extensionPoint = Platform.getExtensionRegistry().getExtensionPoint(
MATPlugin.PLUGIN_ID + ".factory");
with this
1>whats the right approach to use api's of MAT (ie using SnapshotFactory,ISnapshot etc) in Java ..
2>is there any "extension" setup , to override above error message
2>any relevant documentation regarding this
|
|
|
|
|
|
|
|
|
|
|
|
Powered by
FUDForum. Page generated in 0.01886 seconds