How to extend Memory Analyzer [message #1744559] |
Wed, 28 September 2016 09:47 |
Francesco Fucci![Friend of Eclipse Friend](/donate/web-api/friends_decorator.php?email=fr.fucci%40hotmail.it) Messages: 1 Registered: September 2016 |
Junior Member |
|
|
Hi,
I need to develop a tool that acquires a list of HPROF dump stored on the disk and perform a series of analyses on them.
I tried to strictly follow the (very poor) documentation found on the document "How to write extensions for Memory Analyzer", and I came up only with a new empty Eclipse RCP application .
I have just few questions:
Could you please give me some insights about how to put an "Acquire heap dump" function from hard disk?
I tried to start with this plugin:
package matextension;
import org.eclipse.mat.SnapshotException;
import org.eclipse.mat.snapshot.extension.IClassSpecificNameResolver;
import org.eclipse.mat.snapshot.extension.Subject;
import org.eclipse.mat.snapshot.model.IObject;
@Subject("java.lang.Runtime")
public class MATResolver1 implements IClassSpecificNameResolver {
public MATResolver1() {
// TODO Auto-generated constructor stub
}
public String resolve(IObject object) throws SnapshotException {
// TODO Auto-generated method stub
System.out.println(object.getUsedHeapSize());
return "The Java runtime of size"+object.getUsedHeapSize();
}
}
How could I test that this code is actually working?
Thanks,
Francesco
|
|
|
Powered by
FUDForum. Page generated in 0.03519 seconds