01: package tijmp;
02:
03: import java.lang.management.MemoryMXBean;
04: import java.lang.management.MemoryPoolMXBean;
05: import java.util.List;
06:
07: /** A profiler handler, so the actual profiler can be
08: * on the other end of a socket or inside the same jvm.
09: */
10: public interface ProfilerHandler {
11: /** Submit a task for later evaluation. */
12: void submitTask(Runnable r);
13:
14: /** Request that the jvm being profiled does a full gc */
15: void runGC();
16:
17: /** Request a heap dump.
18: * This will start the work, the response will be given to
19: * the current ui later on.
20: */
21: void walkHeap();
22:
23: /** Find all objects below the given object and show a summary.
24: * The just starts a request, the response will be given to
25: * the current ui handler later on.
26: */
27: void childObjectsSummary(Object o);
28:
29: /** Find the objects for a set of tags.
30: */
31: Object[] getObjectsForTags(long[] tags);
32:
33: /** Find all entries of a given class.
34: * This method starts the request and the response will be
35: * given to the current ui handler later on.
36: * @param clz the class to find instances for
37: */
38: void showInstances(Class<?> clz);
39:
40: /** Find all Strings
41: * This method starts the request and the response will be
42: * given to the current ui handler later on.
43: */
44: void showStrings();
45:
46: /** Find owners for all objects of the given class.
47: * This method starts the request and the response will be
48: * given to the current ui handler later on.
49: */
50: void showOwners(Class<?> clz);
51:
52: /** Get the memory mx bean for the vm being profiled.
53: */
54: MemoryMXBean getMemoryMXBean();
55:
56: /** Get the memory pool mx beans for the vm being profiled.
57: */
58: List<MemoryPoolMXBean> getMemoryPoolMXBeans();
59: }
|