-
Notifications
You must be signed in to change notification settings - Fork 10
/
IdeaNativeAgentProxy.java
74 lines (49 loc) · 2.16 KB
/
IdeaNativeAgentProxy.java
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
package com.intellij.memory.agent;
public class IdeaNativeAgentProxy {
public String cancellationFileName;
public String progressFileName;
public long timeoutInMillis;
static {
String agentPath = System.getProperty("intellij.memory.agent.path");
if (agentPath != null) {
System.load(agentPath);
}
}
public IdeaNativeAgentProxy() {
cancellationFileName = "";
progressFileName = "";
timeoutInMillis = -1;
}
public IdeaNativeAgentProxy(Object cancellationFileName, Object progressFileName, long timeoutInMillis) {
this.cancellationFileName = (String)cancellationFileName;
this.progressFileName = (String)progressFileName;
this.timeoutInMillis = timeoutInMillis;
}
public native boolean canEstimateObjectSize();
public native boolean canGetRetainedSizeByClasses();
public native boolean canGetShallowSizeByClasses();
public native boolean canEstimateObjectsSizes();
public native boolean canFindPathsToClosestGcRoots();
public native Object[] getShallowSizeByClasses(Object[] classes);
public native Object[] getRetainedSizeByClasses(Object[] classes);
public native Object[] getShallowAndRetainedSizeByClasses(Object[] classes);
public native Object[] findPathsToClosestGcRoots(Object object, int pathsNumber, int objectsNumber);
public native Object[] size(Object object);
public native Object[] estimateRetainedSize(Object[] objects);
public native Object[] getFirstReachableObject(Object startObject, Object suspectClass);
public native Object[] getAllReachableObjects(Object startObject, Object suspectClass);
public native Object[] getShallowAndRetainedSizesByObjects(Object[] objects);
public native Object[] getSortedShallowAndRetainedSizesByClass(Object classRef, long limit);
static native boolean setHeapSamplingInterval(long interval);
static native boolean initArrayOfListeners(Object array);
static native boolean enableAllocationSampling();
static native boolean disableAllocationSampling();
public static boolean isLoaded() {
try {
return isLoadedImpl();
} catch (Throwable t) {
return false;
}
}
private static native boolean isLoadedImpl();
}